Do a quick search on forums.gentoo.org. You'll see a ton of people with borked systems because they fat-fingered during an etc-update session. (this usually happens in conjunction with emerge -e world, which generates a zillion 'new' configuration files that aren't really new). It's inexcusable that etc-update overwrites files without preserving a backup copy. Reproducible: Always Steps to Reproduce: 1. emerge -e world 2. etc-update 3. hit the wrong keys a few times because there's 17 configuration files to go through 4. curse your fate Actual Results: you get blown up! Expected Results: make a backup copy, ideally with a date stamp or version number. here's a trivial hack to etc-update that implements this: bash-2.05b$ diff -u /usr/sbin/etc-update etc-update --- /usr/sbin/etc-update 2003-10-22 09:04:51.000000000 -0400 +++ etc-update 2003-11-17 15:01:53.000000000 -0500 @@ -8,7 +8,7 @@ # Leo Lipelis <aeoo@gentoo.org> # Karl Trygve Kalleberg <karltk@gentoo.org> # -# $Header: /home/cvsroot/gentoo-src/portage/bin/etc-update,v 1.13 2003/08/04 15:21:15 aether Exp $ +# $Header: /usr/local/cvsroot/gentoo/etc-update,v 1.1 2003/11/17 16:07:47 abennett Exp $ export PORTAGE_CALLER="etc-update" @@ -255,15 +255,18 @@ case ${my_input} in 1) echo "Replacing ${ofile} with ${file}" + backup_file "$ofile" mv ${mv_opts} ${file} ${ofile} continue ;; 2) echo "Deleting ${file}" + backup_file "$ofile" rm ${rm_opts} ${file} continue ;; 3) do_merge "${file}" "${ofile}" - my_input=${?} + backup_file "$ofile" + my_input=${?} # [ ${my_input} == 255 ] && my_input=-1 continue ;; @@ -275,6 +278,12 @@ done } +function backup_file() { + local ofile="${1}" + local backup=.backup-${ofile}-$(date +%F+%R) + cp ${ofile} ${backup} +} + function do_merge() { local file="${1}"
theres a backup option already in /etc/dispatch-conf.conf
*** Bug 95244 has been marked as a duplicate of this bug. ***