autodist: fix checks for already up to date packages and avoid failure with multiple packages scheduled

This commit is contained in:
Silvan Calarco 2012-04-26 15:07:39 +02:00
parent 32ddc9a1ef
commit 57e10e58b4

View File

@ -515,7 +515,7 @@ function launch_pkgs_loop() {
exit 1 ;; exit 1 ;;
esac esac
} }
[ "$operation" = "update" -o "$operation" = "autoupdate" ] && return 0 [ "$operation" = "update" -o "$operation" = "autoupdate" ] && continue
fi fi
fi fi
$SCRIPT_UPDATE_SPECFILE $spec_dir/$pkg.spec $SCRIPT_UPDATE_SPECFILE $spec_dir/$pkg.spec
@ -569,10 +569,11 @@ function launch_pkgs_loop() {
# skip package in job if up to date # skip package in job if up to date
if [ "$PKGLINE" ]; then if [ "$PKGLINE" ]; then
set -- $PKGLINE set -- $PKGLINE
pkglinever=$2
# warning: assuming version is passed first # warning: assuming version is passed first
version_find_bigger ${passed_arguments/ *} $2 version_find_bigger "${passed_arguments/ *}" "$pkglinever"
[ $? -eq 1 ] || { [ $? -eq 1 ] || {
echo "Warning: skipping ${pkg} package already up to date." echo "Warning: skipping ${pkg} package already up to date ($pkglinever >= ${passed_arguments/ *})."
continue continue
} }
fi fi
@ -591,12 +592,14 @@ function launch_pkgs_loop() {
# skip package in job if up to date # skip package in job if up to date
if [ "$PKGLINE" ]; then if [ "$PKGLINE" ]; then
set -- $PKGLINE set -- $PKGLINE
pkglinever=$2
pkglinerel=$6
# warning: assuming version is passed first # warning: assuming version is passed first
version_find_bigger $SPEC_VERSION $2 version_find_bigger "$SPEC_VERSION" "$pkglinever"
[ $? -eq 0 ] && { [ $? -eq 0 ] && {
version_find_bigger $SPEC_RELEASE $6 version_find_bigger "$SPEC_RELEASE" "$pkglinerel"
if [ $? -ne 1 ]; then if [ $? -ne 1 ]; then
echo "Warning: skipping ${pkg} package already up to date." echo "Warning: skipping ${pkg} package already up to date ($SPEC_VERSION-$SPEC_RELEASE >= $pkglinever-$pkglinerel)."
continue continue
fi fi
} }
@ -614,12 +617,14 @@ function launch_pkgs_loop() {
# skip package in job if up to date # skip package in job if up to date
if [ "$PKGLINE" -a "$do_autobuild" ]; then if [ "$PKGLINE" -a "$do_autobuild" ]; then
set -- $PKGLINE set -- $PKGLINE
pkglinever=$2
pkglinerel=$6
# warning: assuming version is passed first # warning: assuming version is passed first
version_find_bigger $SPEC_VERSION $2 version_find_bigger "$SPEC_VERSION" "$pkglinever"
[ $? -eq 0 ] && { [ $? -eq 0 ] && {
version_find_bigger $SPEC_RELEASE $6 version_find_bigger "$SPEC_RELEASE" "$pkglinerel"
if [ $? -ne 1 ]; then if [ $? -ne 1 ]; then
echo "Warning: skipping ${pkg} package already up to date." echo "Warning: skipping ${pkg} package already up to date ($SPEC_VERSION-$SPEC_RELEASE >= $pkglinever-$pkglinerel)."
continue continue
fi fi
} }
@ -846,7 +851,7 @@ if [ "$do_autobuild" = "1" ]; then
# jobs are not fully rebuilt # jobs are not fully rebuilt
for j in ${JOB_PKGS[*]}; do for j in ${JOB_PKGS[*]}; do
REPVER=`grep "^$j " $SRCPKGLIST | gawk '{ print $2 }'` REPVER=`grep "^$j " $SRCPKGLIST | gawk '{ print $2 }'`
version_find_bigger $TRVER $REPVER version_find_bigger "$TRVER" "$REPVER"
[ $? -eq 1 ] && NEED_REBUILD=1 [ $? -eq 1 ] && NEED_REBUILD=1
done done
else else
@ -1034,7 +1039,7 @@ for JOB_NUM in `seq 1 ${#JOBNAME[*]}`; do
## skip package in job if up to date ## skip package in job if up to date
#for j in ${JOB_PKGS[*]}; do #for j in ${JOB_PKGS[*]}; do
# REPVER=`grep "^$j " $SRCPKGLIST | gawk '{ print $2 }'` # REPVER=`grep "^$j " $SRCPKGLIST | gawk '{ print $2 }'`
# version_find_bigger $TRVER $REPVER # version_find_bigger "$TRVER" "$REPVER"
# [ $? -eq 1 ] && NEED_REBUILD=1 # [ $? -eq 1 ] && NEED_REBUILD=1
# done # done
echo "%% Updating to version ${JOB_VER:1}" echo "%% Updating to version ${JOB_VER:1}"