Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 3804 - etc-update running feature request bug
Summary: etc-update running feature request bug
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Brandon Low (RETIRED)
URL:
Whiteboard:
Keywords:
: 3933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-17 05:28 UTC by Jochem Kossen
Modified: 2003-02-04 19:42 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix (fix-etc-update,215 bytes, patch)
2002-06-17 05:29 UTC, Jochem Kossen
Details | Diff
new version of etc-update (etc-update,5.22 KB, text/plain)
2002-06-20 03:10 UTC, Jochem Kossen
Details
My customized version of etc-update (etc-update,8.29 KB, application/octet-stream)
2002-12-27 18:41 UTC, Wayne Davison
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochem Kossen 2002-06-17 05:28:39 UTC
when you choose "skip (keep all files)", etc-update exits, but should move on to
the next file couple. I'll attach a (simple) fix.

Thanks,

jk
Comment 1 Jochem Kossen 2002-06-17 05:29:36 UTC
Created attachment 1565 [details, diff]
fix
Comment 2 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2002-06-18 21:51:46 UTC
Please see if you cannot do something about etc-update's horrible interface. 

1) it should scan through CONFIG_PROTECT
2) check all new config files against the existing ones
3) remove all new config files that are identical to the existing ones
4) list all config files for which there exists (non-trivial) new config files
5) allow the user to look at a diff between the existing and the new config file
6) allow the user to apply, apply+edit or edit

Comment 3 Brandon Low (RETIRED) gentoo-dev 2002-06-20 00:46:26 UTC
ok, etc-update re-write is now actually in progress... I have one more major
function to write, a lot of testing to do, and some minor interface
improvements... (just some fyi for anyone watching this)

karltk: I know you needed more e-mail so I added you as a CC on this ;-)
Comment 4 Jochem Kossen 2002-06-20 03:10:27 UTC
Created attachment 1632 [details]
new version of etc-update

Just woke up and saw Brandon's message...I was busy coding a bit yesterday,
this is the result. Maybe you can do something with it :) The file I attached
is not a diff since it would be about as big as etc-update itself, and Brandon
has his own version...

These are the changes I made so far:
1 code cleanups
2 changed the menus so they're more consistent
3 deletes ._cfg????_* files if they are the same as the old file
4 list files which need updating (although this only appears once, and should
be made into a function and added to the menu)

Now there's a small issue with 3. Before 3, it needs to check if there are
newer updates, and remove the older updates. For example, when
._cfg0003_make.conf exists, it needs to remove ._cfg0002_make.conf and
._cfg0001. Otherwise if ._cfg003_make.conf is the same as make.conf, it would
miss an update/backed out update.
Comment 5 Brandon Low (RETIRED) gentoo-dev 2002-06-20 09:32:13 UTC
I decided to go with a complete from scratch rewrite of the program, and rather
than using the silly little menu system that the old version used I'm using
menus generated at runtime based on the actual files (for most places) 
additionally, at this point I am allowing multiple new config files for the same
config file to be applied as long as they are actually different (I strip out
config updates that are nothing more than CVS header changes...  my script is
NOT complete as I still haven't written the "do_file" function which will
actually interract with the user and decide what to do with non-trivial changes.
 However if you would like to see where I'm going with it, I"ve made it
available at http://www.lostlogicx.com/ebuilds/etc-udpate.sh
currently all it does is strip out duplicates and then ask the user which config
file to play with.
Comment 6 Brandon Low (RETIRED) gentoo-dev 2002-06-20 12:47:34 UTC
*** Bug 3933 has been marked as a duplicate of this bug. ***
Comment 7 Jochem Kossen 2002-06-20 16:41:33 UTC
I like your approach of letting the user decide which file to play with, and i'm
getting curious for the resulting script :) Last couple of days i've also been
thinking of starting from scratch, in a higher level language such as Python,
but i think it would take me too long, as I still don't feel totally comfortable
with it...

btw, could the default pager command be changed to 'less -X' in
/etc/etc-update.conf? It makes less behave a bit nicer in X terminals (ie not
clearing the screen on exit thus showing the diff above the menu...)
Comment 8 Brandon Low (RETIRED) gentoo-dev 2002-06-20 17:44:20 UTC
heh, yeah I considered doing it in a higher level language as well, but my 
decision was that this really is a shell process... not something that should 
be handled within an application interface... and besides which ATM I've been 
doing a lot of bashing so I'm kinda in a bash groove :) btw I just popped a 
somewhat updated version onto my server same place as the old (only thing 
changed really is that I've started on the do_file function... I'm considering 
stealing some of this from your/the old scripts...)
Comment 9 Brandon Low (RETIRED) gentoo-dev 2002-06-25 20:22:24 UTC
Latest version available at http://gentoo.lostlogicx.com/etc-update.sh it should
work now, please test it, read it, whine about it, let me know what thought you
have, cuz IMHO it works pretty well now!  Thanks!
Comment 10 Brandon Low (RETIRED) gentoo-dev 2002-06-25 22:43:11 UTC
feature-request: if the config file has "correct" md5 and mtime, have etc-update
overwrite it with a the newest replacement (if auto_replace is set in
/etc/etc-update.conf)

next: rewrite etc-update using dialog (if available) to display menus.

This is a reminder to me to get to that update as soon as possible, putting
rewritten etc-update in gentoolkit now
Comment 11 Brandon Low (RETIRED) gentoo-dev 2002-06-26 01:54:01 UTC
now available in dialog form (as i mentioned on #gentoo-dev) check it out same
URL as usual, I'll be looking into that other feature soon.
Comment 12 Jochem Kossen 2002-06-26 04:02:56 UTC
Looks nice although i myself don't like dialog very much, it tends to slow me
down. Most other people will probably like it though, so it's a good choice.

<whine>
$pager seems to be unused. Showing difference between files does not work...
</whine>
Comment 13 Brandon Low (RETIRED) gentoo-dev 2002-06-26 10:27:52 UTC
differences between files doesn't work?  I am unaware of that!

and yes $pager is now unused in the dialog version...

I'm going to see how ugly it is for me to make dialog vs. no dialog a
configuration option.
Comment 14 Chad Huneycutt (RETIRED) gentoo-dev 2002-07-02 13:39:38 UTC
Here is a suggestion:

Showing the list of files is fine, but the default behavior should be to always
take the next one if you don't type a number.
Comment 15 Brandon Low (RETIRED) gentoo-dev 2002-07-13 11:01:56 UTC
OK, I've got the defaulting to next file bit all set in the text mode version,
I'm currently working on combining the two modes into one sweet script with an
additional configuration variable called mode. expect a fancy new version
hopefully before the end of the weekend.
Comment 16 Brandon Low (RETIRED) gentoo-dev 2002-07-14 09:56:44 UTC
Ok, a lot of this stuff is getting done, I have a beta version of the script
(not done merging in menu support so it just defaults to text mode still)
available at http://gentoo.lostlogicx.com/etc-udpate.both try that on for size
and let me know if there are other things that still suck a lot.

My current todo on etc-update:
1) Finish merging menu support with text mode
2) Reduce the lengh of the messages accross the board
Comment 17 Brandon Low (RETIRED) gentoo-dev 2002-07-14 17:57:20 UTC
Just bumped gentoolkit cuz of semi-critical bug in etc-update (not keeping
fperms in merging) should be fixored in latest gentoolkit on cvs... still
working on completing the mode etc-update.conf option.
Comment 18 PJ 2002-08-26 22:02:55 UTC
Upon not entering Y or N when confirmation a file deletion or override, it 
might be a good idea to have it loop within the overwrite or delete list 
instead of returning to the main menu.
Comment 19 Brandon Low (RETIRED) gentoo-dev 2002-09-02 21:54:45 UTC
note: still need to finish menu merge
also, if nothing is done to a file loop within the file until the user
explicitly says what else to do.
Comment 20 Brandon Low (RETIRED) gentoo-dev 2002-09-03 17:38:47 UTC
1 down, 1 to go, also this is going into portage from gentoolkit now...

on my todo: menu merge, the other is now done :)
Comment 21 Wayne Davison 2002-12-27 18:41:44 UTC
Created attachment 6790 [details]
My customized version of etc-update

I did some hacking on the etc-update script because I didn't like the numeric
command characters.  The result is this shell script.  In addition to changing
the command characters to things like 'u' for update and 'm' for merge (while
still accepting the old numeric values for those with trained fingers), I also
improved some of the prompts to be friendlier to those just encountering the
tool (e.g. it mentions that you can press <Enter> to process the next file in
the list).

I don't know if this will be useful with the other mods going on, but feel free
to take a look at it and see if you like the interface any better than what's
there now.
Comment 22 Brandon Low (RETIRED) gentoo-dev 2003-01-17 11:29:27 UTC
etc-update is in the process of being replaced with a python script to do the
equivalent only better.  See a big for dispatch-conf assigned to carpaski