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

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson 2017-12-28 21:32:10 -08:00
parent 731b5886ad
commit 5d73c6b04a
No known key found for this signature in database
GPG key ID: 19395F23C58826C4

View file

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