Summary: | etc-update running feature request bug | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jochem Kossen <j.kossen> |
Component: | Current packages | Assignee: | Brandon Low (RETIRED) <lostlogic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gentoo, helix, karltk |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
fix
new version of etc-update My customized version of etc-update |
Description
Jochem Kossen
2002-06-17 05:28:39 UTC
Created attachment 1565 [details, diff]
fix
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 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 ;-) 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.
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. *** Bug 3933 has been marked as a duplicate of this bug. *** 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...) 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...) 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! 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 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. 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> 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. 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. 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. 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 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. 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. 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. 1 down, 1 to go, also this is going into portage from gentoolkit now... on my todo: menu merge, the other is now done :) 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.
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 |