etc-update: add a --preen flag
authorMike Frysinger <vapier@gentoo.org>
Sun, 11 Mar 2012 02:54:59 +0000 (21:54 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 11 Mar 2012 02:54:59 +0000 (21:54 -0500)
Add a flag to merge just trivial updates and then quit.

URL: http://bugs.gentoo.org/159080
Reported-by: Iván Pérez Domínguez <iperez@babel.ls.fi.upm.es>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
bin/etc-update
man/etc-update.1

index c49c4b8f6eed6273d1d5469971d884a4d0e1399d..cd63ae14be8cb2239b0adc21ae0b5bc10628bcee 100755 (executable)
@@ -551,6 +551,7 @@ usage() {
        Options:
          -d, --debug    Enable shell debugging
          -h, --help     Show help and run away
+         -p, --preen    Automerge trivial changes only and quit
          -v, --verbose  Show settings and such along the way
          -V, --version  Show version and trundle away
 
@@ -574,12 +575,14 @@ declare -i count=0
 declare input=0
 declare title="Gentoo's etc-update tool!"
 
+PREEN=false
 SET_X=false
 VERBOSE=false
 while [[ -n $1 ]] ; do
        case $1 in
                -d|--debug)   SET_X=true;;
                -h|--help)    usage;;
+               -p|--preen)   PREEN=true;;
                -v|--verbose) VERBOSE=true;;
                -V|--version) emerge --version; exit 0;;
                --automode)   parse_automode_flag $2 && shift || usage 1 "Invalid mode '$2'";;
@@ -674,6 +677,8 @@ fi
 
 scan
 
+${PREEN} && exit 0
+
 until (( input == -1 )); do
        if (( count == 0 )); then
                die "Nothing left to do; exiting. :)" 0
index 85d102d926acede0aa4c824cbea5d1efd025a111..366e8500bd4081b8a30b3d1775e1ba384dae2c4d 100644 (file)
@@ -27,9 +27,12 @@ for finding the aforementioned config protect variables.
 .BR \-d ", " \-\-debug
 Run with shell tracing enabled.
 .TP
-.BR \h ", " \-\-help
+.BR \-h ", " \-\-help
 Surprisingly, show the help output.
 .TP
+.BR \-p ", " \-\-preen
+Automerge trivial changes only and quit.
+.TP
 .BR \-v ", " \-\-verbose
 Show settings and important decision info while running.
 .TP