From 815f1373bac6cf594cd76f3f17c84a05fe4734c4 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 30 Oct 2009 02:18:48 +0100 Subject: [PATCH] repod -q: Implement quiet mode --- daemons/repod.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/daemons/repod.sh b/daemons/repod.sh index 2335f54..a6b6fb2 100755 --- a/daemons/repod.sh +++ b/daemons/repod.sh @@ -10,6 +10,8 @@ # instead of in infinite loop. Or call with parameter --one and name # of a project (not full path, without .git suffix) to run maintenance # only on that particular project. +# +# Use -q as VERY FIRST parameter to enable quiet mode (use in cronjobs). . @basedir@/shlib.sh @@ -34,7 +36,11 @@ check_one_proj() if [ ! -e "$proj.git"/.nofetch ]; then "$cfg_basedir"/daemons/update.sh "$proj" fi - "$cfg_basedir"/jobs/gc.sh "$proj" # 2>&1 | grep -v '^Pack.*created\.$' + if [ -n "$show_progress" ]; then + "$cfg_basedir"/jobs/gc.sh "$proj" + else + "$cfg_basedir"/jobs/gc.sh "$proj" 2>&1 | grep -v '^Pack.*created\.$' + fi } @@ -50,6 +56,11 @@ check_all_projects() ## Main program +if [ "$1" = "-q" ]; then + export show_progress= + shift +fi + case "$1" in "") while true; do @@ -61,6 +72,6 @@ case "$1" in "--one") check_one_proj "$2";; *) - echo "Usage: $0 [--all-once | --one PRJNAME]" >&2 + echo "Usage: $0 [-q] [--all-once | --one PRJNAME]" >&2 exit 1;; esac -- 2.11.4.GIT