diff --git a/autodist b/autodist index a64a838..c34c55b 100755 --- a/autodist +++ b/autodist @@ -5,8 +5,8 @@ # # Released under the terms of the GNU GPL release 3 license # -VERSION=0.9.21 -me=(${0##*/} $VERSION "Sat Aug 20 2010") +VERSION=0.9.22 +me=(${0##*/} $VERSION "Tue Jan 26 2016") exec 3>`readlink /proc/self/fd/0` function usage() { @@ -40,10 +40,11 @@ ${me[0]} ${me[1]} -v,--verbose "$"Be verbose"" --force "$"Pass force parameter to autospec"" --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"" --severity num "$"Error handling level: - 0: don't stop (default) - 1: skip current job on error + 0: don't stop + 1: skip current job on error (default) 2: abort on error"" --arch "$"Build packages for specified target architecture"" --user user "$"Pass calling user name for Webbuild social messages"" @@ -169,6 +170,9 @@ for ((i=1; i<=$#; i++)); do } AUTODIST_REPOSITORY="${!i}" ;; + --repository-strict) + REPOSITORY_STRICT=1 + ;; --severity) let i+=1 [ "${!i}" ] || { echo "Error: --severity parameter not given, aborting." @@ -627,6 +631,15 @@ function launch_pkgs_loop() { if [ "$PKGLINE" ]; then set -- $PKGLINE [[ $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 command_opts="$command_opts --server ${REPNAME}" else diff --git a/autoport b/autoport index b71a9a5..0f0d3da 100755 --- a/autoport +++ b/autoport @@ -542,9 +542,14 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do done [ ! "$DONT_PREPARE_THIS" -a ! "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs`" ] && { echo -n "prepare" + if [ ! "$REBUILD_DEPENDANT_MODE" ]; then + REPOSITORY_STRICT_ADD="--repository-strict" + else + REPOSITORY_STRICT_ADD="" + fi [ "$VERBOSE_MODE" ] && echo " -%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS" - LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS &>$tmpfile +%% 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 $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS &>$tmpfile cat $tmpfile >> $logfile [ $? -gt 0 ] && { RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT`