autodist: add --repository-string to limit autoport of pacakges from specified repository

autoport: update accordingly
This commit is contained in:
Silvan Calarco 2016-02-15 08:07:58 +01:00
parent 1c8a7cbbdf
commit a49c4ec447
2 changed files with 24 additions and 6 deletions

View File

@ -5,8 +5,8 @@
# #
# Released under the terms of the GNU GPL release 3 license # Released under the terms of the GNU GPL release 3 license
# #
VERSION=0.9.21 VERSION=0.9.22
me=(${0##*/} $VERSION "Sat Aug 20 2010") me=(${0##*/} $VERSION "Tue Jan 26 2016")
exec 3>`readlink /proc/self/fd/0` exec 3>`readlink /proc/self/fd/0`
function usage() { function usage() {
@ -40,10 +40,11 @@ ${me[0]} ${me[1]}
-v,--verbose "$"Be verbose"" -v,--verbose "$"Be verbose""
--force "$"Pass force parameter to autospec"" --force "$"Pass force parameter to autospec""
--repository "$"Pass given repository as base for operations"" --repository "$"Pass given repository as base for operations""
--repository-strict "$"Only prepare packages from base repository specified with --repository""
--server num "$"Pass given server number to autospec for send operation"" --server num "$"Pass given server number to autospec for send operation""
--severity num "$"Error handling level: --severity num "$"Error handling level:
0: don't stop (default) 0: don't stop
1: skip current job on error 1: skip current job on error (default)
2: abort on error"" 2: abort on error""
--arch "$"Build packages for specified target architecture"" --arch "$"Build packages for specified target architecture""
--user user "$"Pass calling user name for Webbuild social messages"" --user user "$"Pass calling user name for Webbuild social messages""
@ -169,6 +170,9 @@ for ((i=1; i<=$#; i++)); do
} }
AUTODIST_REPOSITORY="${!i}" AUTODIST_REPOSITORY="${!i}"
;; ;;
--repository-strict)
REPOSITORY_STRICT=1
;;
--severity) let i+=1 --severity) let i+=1
[ "${!i}" ] || { [ "${!i}" ] || {
echo "Error: --severity parameter not given, aborting." echo "Error: --severity parameter not given, aborting."
@ -627,6 +631,15 @@ function launch_pkgs_loop() {
if [ "$PKGLINE" ]; then if [ "$PKGLINE" ]; then
set -- $PKGLINE set -- $PKGLINE
[[ $4 =~ "^[0-9]+$" ]] && REPNAME=${AUTODIST_REPOSITORIES[$4]} || REPNAME="$4" [[ $4 =~ "^[0-9]+$" ]] && REPNAME=${AUTODIST_REPOSITORIES[$4]} || REPNAME="$4"
if [ "$REPNAME" != "$AUTODIST_REPOSITORY" -a "$REPOSITORY_STRICT" ]; then
case $SEVERITY in
0) echo "!! Warning: package comes from $REPNAME instead of $AUTODIST_REPOSITORY" ;;
1) echo "!! Error: package comes from $REPNAME instead of $AUTODIST_REPOSITORY; skipping $pkg package."
continue ;;
*) echo "!! Error: package comes from $REPNAME instead of $AUTODIST_REPOSITORY; aborting."
exit 1 ;;
esac
fi
if [ "$REPNAME" ]; then if [ "$REPNAME" ]; then
command_opts="$command_opts --server ${REPNAME}" command_opts="$command_opts --server ${REPNAME}"
else else

View File

@ -542,9 +542,14 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
done done
[ ! "$DONT_PREPARE_THIS" -a ! "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs`" ] && { [ ! "$DONT_PREPARE_THIS" -a ! "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs`" ] && {
echo -n "prepare" echo -n "prepare"
if [ ! "$REBUILD_DEPENDANT_MODE" ]; then
REPOSITORY_STRICT_ADD="--repository-strict"
else
REPOSITORY_STRICT_ADD=""
fi
[ "$VERBOSE_MODE" ] && echo " [ "$VERBOSE_MODE" ] && echo "
%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS" %% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS"
LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS &>$tmpfile LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS &>$tmpfile
cat $tmpfile >> $logfile cat $tmpfile >> $logfile
[ $? -gt 0 ] && { [ $? -gt 0 ] && {
RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT` RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT`