-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlD+pWoACgkQrlYvE4MpobPURQCff3I+EPdpfpXxDIrkl320Mv7V B1kAmgIzghWxk22ZW+dBYtYlkdJqBSMx =fp3s -----END PGP SIGNATURE-----
>From 4c7d01277cf084badf933dd719646e94ce69c7bb Mon Sep 17 00:00:00 2001 From: rhatdan <dwalsh@xxxxxxxxxx> Date: Mon, 17 Sep 2012 14:51:57 -0400 Subject: [PATCH 24/84] policycoreutils: Allow the users to override the progress bar, with verbosity. IE Run restorecon with -v rather then -p --- policycoreutils/scripts/fixfiles | 14 +++++++++----- policycoreutils/scripts/fixfiles.8 | 10 +++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles index 989b1ae..19a4ff0 100755 --- a/policycoreutils/scripts/fixfiles +++ b/policycoreutils/scripts/fixfiles @@ -114,6 +114,7 @@ exclude_dirs() { # Set global Variables # fullFlag=0 +VERBOSE="-p" FORCEFLAG="" DIRS="" RPMILES="" @@ -176,7 +177,7 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then esac; \ fi; \ done | \ - ${RESTORECON} -i -f - -R -p `exclude_dirs`; \ + ${RESTORECON} ${VERBOSE} -i -f - -R `exclude_dirs`; \ rm -f ${TEMPFILE} ${PREFCTEMPFILE} fi } @@ -206,12 +207,12 @@ if [ ! -z "$PREFC" ]; then fi if [ ! -z "$RPMFILES" ]; then for i in `echo "$RPMFILES" | sed 's/,/ /g'`; do - rpmlist $i | ${RESTORECON} ${FORCEFLAG} $* -R -i -f - 2>&1 | cat >> $LOGFILE + rpmlist $i | ${RESTORECON} ${FORCEFLAG} ${VERBOSE} $* -R -i -f - 2>&1 | cat >> $LOGFILE done exit $? fi if [ ! -z "$FILEPATH" ]; then - ${RESTORECON} ${FORCEFLAG} -R $* $FILEPATH 2>&1 | cat >> $LOGFILE + ${RESTORECON} ${FORCEFLAG} ${VERBOSE} -R $* $FILEPATH 2>&1 | cat >> $LOGFILE return fi [ -x /usr/sbin/genhomedircon ] && /usr/sbin/genhomedircon @@ -286,7 +287,7 @@ process() { # Make sure they specified one of the three valid commands # case "$1" in - restore) restore -p ;; + restore) restore;; check) restore -n -v;; verify) restore -n -o -;; relabel) relabel;; @@ -317,11 +318,14 @@ if [ $# = 0 ]; then fi # See how we were called. -while getopts "C:FfR:l:" i; do +while getopts "C:FfR:l:v" i; do case "$i" in f) fullFlag=1 ;; + v) + VERBOSE="-v" + ;; R) RPMFILES=$OPTARG ;; diff --git a/policycoreutils/scripts/fixfiles.8 b/policycoreutils/scripts/fixfiles.8 index 0b4cbaa..9ab7334 100644 --- a/policycoreutils/scripts/fixfiles.8 +++ b/policycoreutils/scripts/fixfiles.8 @@ -5,13 +5,13 @@ fixfiles \- fix file SELinux security contexts. .SH "SYNOPSIS" .B fixfiles -.I [-F] [-l logfile ] { check | restore|[-f] relabel | verify } [[dir/file] ... ] +.I [-v] [-F] [-l logfile ] { check | restore|[-f] relabel | verify } [[dir/file] ... ] .B fixfiles -.I [-F] [ -R rpmpackagename[,rpmpackagename...] ] [-l logfile ] { check | restore | verify } +.I [-v] [-F] [ -R rpmpackagename[,rpmpackagename...] ] [-l logfile ] { check | restore | verify } .B fixfiles -.I [ -C PREVIOUS_FILECONTEXT ] [-l logfile ] { check | restore | verify } +.I [-v] [ -C PREVIOUS_FILECONTEXT ] [-l logfile ] { check | restore | verify } .B fixfiles .I onboot @@ -54,6 +54,10 @@ Use the rpm database to discover all files within the specified packages and res .B -C PREVIOUS_FILECONTEXT Run a diff on the PREVIOUS_FILECONTEXT file to the currently installed one, and restore the context of all affected files. +.TP +.B -v +Modify verbosity from progess to verbose. (Run restorecon with -v instead of -p) + .SH "ARGUMENTS" One of: .TP -- 1.8.1