From 9ed31a82e7d5a26bdcfdca1107cf58c542a02fc1 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 30 Oct 2009 02:04:10 +0100 Subject: [PATCH] repod: Support --all-once and --one switches --- daemons/repod.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/daemons/repod.sh b/daemons/repod.sh index 97b440e..43ca5d3 100755 --- a/daemons/repod.sh +++ b/daemons/repod.sh @@ -5,6 +5,11 @@ # repod is Girocco repositories maintenance servant; it periodically # checks all the repositories and updates mirrored repositories and # repacks push-repositories when needed. +# +# Execute with parameter --all-once to run only once (on all projects) +# 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. . @basedir@/shlib.sh @@ -42,7 +47,17 @@ check_all_projects() ## Main program -while true; do - check_all_projects - sleep 10 -done +case "$1" in + "") + while true; do + check_all_projects + sleep 10 + done;; + "--all-once") + check_all_projects;; + "--one") + check_one_proj "$2";; + *) + echo "Usage: $0 [--all-once | --one PRJNAME]" >&2 + exit 1;; +esac -- 2.11.4.GIT