autodist: added --list-pkg option and fix for jobs starting with a number (54321)
This commit is contained in:
parent
eebf7f263d
commit
1f088616ad
38
autodist
38
autodist
@ -28,6 +28,7 @@ ${me[0]} ${me[1]}
|
||||
-i,--install "$"Install packages on local system""
|
||||
-s,--send "$"Send packages to repository""
|
||||
--list-jobs "$"List configured jobs""
|
||||
--list-pkgs job "$"List packages for specified job""
|
||||
|
||||
"$"Options"":
|
||||
-c,--cleanlogs "$"Clean all logs before starting""
|
||||
@ -127,6 +128,14 @@ for ((i=1; i<=$#; i++)); do
|
||||
-q|--quiet) quiet=1 ;;
|
||||
-v|--verbose) verbose=1 ;;
|
||||
--list-jobs) do_listjobs=1 ;;
|
||||
--list-pkgs) do_listpkgs=1
|
||||
let i+=1
|
||||
[ "${!i}" ] || {
|
||||
echo "Error: job parameter not given, aborting."
|
||||
exit 1
|
||||
}
|
||||
LISTPKGSJOB="${!i}"
|
||||
;;
|
||||
--force) SEND_FORCE="--force"
|
||||
SEND_FORCE_BUILD="--force-build"
|
||||
;;
|
||||
@ -182,6 +191,7 @@ done
|
||||
|
||||
SEND_SERVER_CMD="--server $SEND_SERVER"
|
||||
AUTOUPDATEDIR=${LOCAL_REPS_BASE_DIR}/$AUTODIST_REPOSITORY/autoupdate/
|
||||
|
||||
[ -r $AUTOUPDATEDIR ] || {
|
||||
AUTOUPDATEDIR=$USERCONFDIR/$AUTODIST_REPOSITORY/autoupdate
|
||||
mkdir -p $AUTOUPDATEDIR
|
||||
@ -383,6 +393,10 @@ get_job_vector() {
|
||||
local JPKG=
|
||||
[ "$JTARGET" != "$1" ] && JPKG="${1/*\/}"
|
||||
local JNAME=`echo $JTARGET | tr - _`
|
||||
if [[ ${JNAME:0:1} =~ [0-9] ]]; then
|
||||
# prepend a underscore to job names starting with a number (e.g. 54321)
|
||||
JNAME="_$JNAME"
|
||||
fi
|
||||
|
||||
# resolve JOB_NAME from distdb
|
||||
local jobtmpfile=`tempfile`
|
||||
@ -400,10 +414,10 @@ get_job_vector() {
|
||||
JOB=(${JOB[*]} "" "")
|
||||
elif [ "${JPKG}" ]; then
|
||||
TMPJOB=($JPKG)
|
||||
for i in `seq 4 ${#JOB[*]}`; do
|
||||
for i in `seq 1 ${#JOB[*]}`; do
|
||||
TMPJOB=(${TMPJOB[*]} "${JOB[$i]}")
|
||||
done
|
||||
JOB=${TMPJOB[*]}
|
||||
JOB=(${TMPJOB[*]})
|
||||
fi
|
||||
JOB_PKGS=(${JOB[0]//,/ })
|
||||
JOB_VARNAMES=(${JOB[1]//,/ })
|
||||
@ -822,12 +836,27 @@ DISTDBFILES="$DISTDB"
|
||||
[ -e ~/.autodist/distdb ] && DISTDBFILES="$DISTDBFILES ~/.autodist/distdb"
|
||||
[ -e ~/.autodist/distdb.$TARGETARCH ] && DISTDBFILES="$DISTDBFILES ~/.autodist/distdb.$TARGETARCH"
|
||||
|
||||
if [ "$do_listjobs" ]; then
|
||||
for f in $DISTDBFILES; do
|
||||
for j in `grep -v "^#" $f | grep ".*=(" | sed "s|\(.*\)=(.*|\1|"`; do
|
||||
echo $j
|
||||
done
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# include global distdb files
|
||||
for f in $DISTDBFILES; do
|
||||
[ "$do_listjobs" ] && grep -v "^#" $f | grep ".*=(" | sed "s|\(.*\)=(.*|\1|"
|
||||
. $f
|
||||
done
|
||||
|
||||
[ "$do_listjobs" ] && exit 0
|
||||
if [ "$do_listpkgs" ]; then
|
||||
get_job_vector $LISTPKGSJOB
|
||||
for p in ${JOB_PKGS[*]}; do
|
||||
echo $p
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# FIXME: DISTDBDIR contains private jobs we don't want to publish on webbuild
|
||||
for f in $DISTDBDIR/*.db; do
|
||||
@ -864,6 +893,7 @@ if [ "$do_autobuild" = "1" ]; then
|
||||
exit 1
|
||||
}
|
||||
srctmpfile=`tempfile`
|
||||
|
||||
cat $AUTOUPDATEDIR/*.in > $srctmpfile
|
||||
cat $SRCPKGLIST | sort --key=3 >> $srctmpfile
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user