commit:     5d73c6b04ae06319ba5cc7bed9902249284494a1
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 29 05:32:10 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 05:32:10 2017 +0000
URL:        https://gitweb.gentoo.org/proj/releng.git/commit/?id=5d73c6b0

catalyst-auto: add intermediate verbose, that prints the command, but not the 
output; -vv has old behavior

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 tools/catalyst-auto | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/catalyst-auto b/tools/catalyst-auto
index cd26f969..02115d1c 100755
--- a/tools/catalyst-auto
+++ b/tools/catalyst-auto
@@ -77,9 +77,12 @@ run_cmd() {
   local logfile="$1"
   shift
 
-  if [ $verbose = 1 ]; then
+  if [ $verbose = 2 ]; then
     echo "*** Running command: $*"
     "$@" 2>&1 | tee -a "${logfile}"
+  elif [ $verbose = 1 ]; then
+    echo "*** Running command: $*"
+    "$@" &>> "${logfile}"
   else
     "$@" &>> "${logfile}"
   fi
@@ -137,7 +140,7 @@ do
       shift
       ;;
     -v|--verbose)
-      verbose=1
+      verbose=$(($verbose+1))
       ;;
     -k|--keep-tmpdir)
       keep_tmpdir=1
@@ -224,7 +227,7 @@ if [[ ${preclean} -eq 1 ]]; then
   mkdir "${TMPDIR}"
 fi
 
-if [ ${verbose} = 1 ]; then
+if [ ${verbose} -ge 1 ]; then
   echo "TMPDIR = ${TMPDIR}"
   echo "DATESTAMP = ${DATESTAMP}"
   echo "TIMESTAMP = ${TIMESTAMP}"

Reply via email to