autodist: added option --list-jobs for webdist to know all available jobs

This commit is contained in:
Silvan Calarco 2012-09-06 18:52:58 +02:00
parent 0d02eac831
commit 455ca50f06

View File

@ -27,6 +27,7 @@ ${me[0]} ${me[1]}
-b,--build "$"Build packages""
-i,--install "$"Install packages on local system""
-s,--send "$"Send packages to repository""
--list-jobs "$"List configured jobs""
"$"Options"":
-c,--cleanlogs "$"Clean all logs before starting""
@ -85,13 +86,6 @@ SEND_SERVER=
[ -r $CONFIGFILE ] && . $CONFIGFILE
eval `autospec -q --eval="srpms_dir"`
eval `autospec -q --eval="rpms_dir"`
eval `autospec -q --eval="spec_dir"`
eval `autospec -q --eval="source_dir"`
eval `autospec -q --eval="tmppath_dir"`
# init environment especially to have a full PATH when executed by crond with
# system init PATH
. /etc/profile
@ -132,6 +126,7 @@ for ((i=1; i<=$#; i++)); do
-t|--test) simulate=1 ;;
-q|--quiet) quiet=1 ;;
-v|--verbose) verbose=1 ;;
--list-jobs) do_listjobs=1 ;;
--force) SEND_FORCE="--force"
SEND_FORCE_BUILD="--force-build"
;;
@ -250,13 +245,6 @@ esac
# exit 1
#}
. $DISTDB
[ -e $DISTDB.$TARGETARCH ] && . $DISTDB.$TARGETARCH
[ -d $DISTDBDIR ] && \
for f in `ls $DISTDBDIR/*.db`; do
. $f
done
function tempfile() {
local tmpfile
tmpfile=`mktemp -q -t $me.XXXXXXXX` || {
@ -807,6 +795,29 @@ function log_date() {
echo -n `LANG=C date +%Y%m%d@%H%M%S`
}
DISTDBFILES="$DISTDB"
[ -e $DISTDB.$TARGETARCH ] && DISTDBFILES="$DISTDBFILES $DISTDB.$TARGETARCH"
[ -e ~/.autodist/distdb ] && DISTDBFILES="$DISTDBFILES ~/.autodist/distdb"
[ -e ~/.autodist/distdb.$TARGETARCH ] && DISTDBFILES="$DISTDBFILES ~/.autodist/distdb.$TARGETARCH"
for f in $DISTDBFILES; do
[ "$do_listjobs" ] && grep -v "^#" $f | grep ".*=(" | sed "s|\(.*\)=(.*|\1|"
. $f
done
[ "$do_listjobs" ] && exit 0
# FIXME: DISTDBDIR contains private jobs we don't want to publish on webbuild
for f in $DISTDBDIR/*.db; do
. $f
done
eval `autospec -q --eval="srpms_dir"`
eval `autospec -q --eval="rpms_dir"`
eval `autospec -q --eval="spec_dir"`
eval `autospec -q --eval="source_dir"`
eval `autospec -q --eval="tmppath_dir"`
for a in $LOGBASEDIR/{,prepare/{,ok,failed},update/{,ok,failed},build/{,ok,failed},install/{,ok,failed},send/{,ok,failed}}; do
[ ! -w $a ] && {