autodist: improved management of skipped packages, delayed repository and other small fixes
This commit is contained in:
parent
61a6f72850
commit
1e2ba88e57
72
autodist
72
autodist
@ -504,7 +504,7 @@ function launch_pkgs_loop() {
|
|||||||
if [ $JOB_IDX -eq 0 -a "$do_autobuild" ]; then
|
if [ $JOB_IDX -eq 0 -a "$do_autobuild" ]; then
|
||||||
# preserve specfile modification date
|
# preserve specfile modification date
|
||||||
if [ -e $AUTOUPDATEDIR/spec-patches-$patch_operation/$pkg.spec.patch ]; then
|
if [ -e $AUTOUPDATEDIR/spec-patches-$patch_operation/$pkg.spec.patch ]; then
|
||||||
echo -n "== "
|
echo -n "?= "
|
||||||
patch -p1 $spec_dir/$pkg.spec $AUTOUPDATEDIR/spec-patches-$patch_operation/$pkg.spec.patch || {
|
patch -p1 $spec_dir/$pkg.spec $AUTOUPDATEDIR/spec-patches-$patch_operation/$pkg.spec.patch || {
|
||||||
case $SEVERITY in
|
case $SEVERITY in
|
||||||
0) ;;
|
0) ;;
|
||||||
@ -548,6 +548,28 @@ function launch_pkgs_loop() {
|
|||||||
[ -e "$SRCPKGLIST" ] && PKGLINE=`grep "^${pkg} " $SRCPKGLIST` || PKGLINE=
|
[ -e "$SRCPKGLIST" ] && PKGLINE=`grep "^${pkg} " $SRCPKGLIST` || PKGLINE=
|
||||||
[ -e "$SRCPKGLIST_DELAYED" ] && PKGLINE_DELAYED=`grep "^${pkg} " $SRCPKGLIST_DELAYED` || PKGLINE_DELAYED=
|
[ -e "$SRCPKGLIST_DELAYED" ] && PKGLINE_DELAYED=`grep "^${pkg} " $SRCPKGLIST_DELAYED` || PKGLINE_DELAYED=
|
||||||
|
|
||||||
|
if [ "$PKGLINE_DELAYED" -a "$do_autobuild" ]; then
|
||||||
|
set -- $PKGLINE
|
||||||
|
_ver1=$2
|
||||||
|
_rel1=$6
|
||||||
|
set -- $PKGLINE_DELAYED
|
||||||
|
_ver2=$2
|
||||||
|
_rel2=$6
|
||||||
|
version_find_bigger ${_ver1} ${_ver2}
|
||||||
|
if [ $? -eq 2 ]; then
|
||||||
|
PKGLINE=$PKGLINE_DELAYED
|
||||||
|
echo "!! Warning: using package from delayed repository (${_ver2} > ${_ver1})"
|
||||||
|
elif [ $? -eq 0 ]; then
|
||||||
|
version_find_bigger ${_rel1} ${_rel2}
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "!! Warning: package with same version (${_ver1}-${_rel1}) exists in delayed repository"
|
||||||
|
elif [ $? -eq 2 ]; then
|
||||||
|
echo "!! Warning: using package from delayed repository (${_ver2}-${_rel2} > ${_ver1}-${_rel1})"
|
||||||
|
PKGLINE=$PKGLINE_DELAYED
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
case $operation in
|
case $operation in
|
||||||
prepare)
|
prepare)
|
||||||
command_opts="-a1"
|
command_opts="-a1"
|
||||||
@ -570,10 +592,12 @@ function launch_pkgs_loop() {
|
|||||||
if [ "$PKGLINE" ]; then
|
if [ "$PKGLINE" ]; then
|
||||||
set -- $PKGLINE
|
set -- $PKGLINE
|
||||||
pkglinever=$2
|
pkglinever=$2
|
||||||
# warning: assuming version is passed first
|
# warning: asasuming version is passed first
|
||||||
version_find_bigger "${passed_arguments/ *}" "$pkglinever"
|
version_find_bigger "${passed_arguments/ *}" "$pkglinever"
|
||||||
[ $? -eq 1 ] || {
|
[ $? -eq 1 ] || {
|
||||||
echo "!! Warning: skipping ${pkg} package already up to date ($pkglinever >= ${passed_arguments/ *})."
|
echo "!! Warning: skipping ${pkg} package already up to date ($pkglinever >= ${passed_arguments/ *})."
|
||||||
|
echo "%% Adding ${pkg} job to skipped list."
|
||||||
|
echo "${pkg} $DATE_NOW 255" >> $SKIPPEDLISTDIR/auto.skip
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
@ -584,6 +608,8 @@ function launch_pkgs_loop() {
|
|||||||
set -- $PKGLINE_DELAYED
|
set -- $PKGLINE_DELAYED
|
||||||
if [ "$SPEC_VERSION-$SPEC_RELEASE" = "$2-$6" ]; then
|
if [ "$SPEC_VERSION-$SPEC_RELEASE" = "$2-$6" ]; then
|
||||||
echo "!! Warning: skipping ${pkg} package build because already present in delayed repository."
|
echo "!! Warning: skipping ${pkg} package build because already present in delayed repository."
|
||||||
|
echo "%% Adding ${pkg} job to skipped list."
|
||||||
|
echo "${pkg} $DATE_NOW 254" >> $SKIPPEDLISTDIR/auto.skip
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -647,7 +673,8 @@ function launch_pkgs_loop() {
|
|||||||
|
|
||||||
command="$AUTOSPEC_CMD -u $pkg $command_opts $passed_arguments $JOB_ARGS"
|
command="$AUTOSPEC_CMD -u $pkg $command_opts $passed_arguments $JOB_ARGS"
|
||||||
|
|
||||||
tmpfile=`tempfile`
|
tmpfile=${LOGBASEDIR}/current.$$
|
||||||
|
> $tmpfile
|
||||||
tmpfile1=`tempfile`
|
tmpfile1=`tempfile`
|
||||||
echo -n "== "`log_date`" $JOB_NAME with args: $JOB_ARGS..." >> $LOGFILE
|
echo -n "== "`log_date`" $JOB_NAME with args: $JOB_ARGS..." >> $LOGFILE
|
||||||
echo "
|
echo "
|
||||||
@ -717,12 +744,12 @@ function launch_pkgs_loop() {
|
|||||||
;;
|
;;
|
||||||
update|autoupdate)
|
update|autoupdate)
|
||||||
cp $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.prebuild
|
cp $spec_dir/$pkg.spec $spec_dir/.$pkg.spec.autodist.prebuild
|
||||||
SPEC_EPOCH=`grep "Epoch:" $spec_dir/$pkg.spec | sed "s|Epoch:[[:space:]]*||"`
|
SPEC_EPOCH=`grep -m1 "^Epoch:" $spec_dir/$pkg.spec | sed "s|Epoch:[[:space:]]*||"`
|
||||||
SPEC_VERSION=`grep "Version:" $spec_dir/$pkg.spec | sed "s|Version:[[:space:]]*||"`
|
SPEC_VERSION=`grep -m1 "^Version:" $spec_dir/$pkg.spec | sed "s|Version:[[:space:]]*||"`
|
||||||
SPEC_RELEASE=`grep "Release:" $spec_dir/$pkg.spec | sed "s|Release:[[:space:]]*||"`
|
SPEC_RELEASE=`grep -m1 "^Release:" $spec_dir/$pkg.spec | sed "s|Release:[[:space:]]*||"`
|
||||||
if [ "$PKGLINE" ]; then
|
if [ "$PKGLINE" ]; then
|
||||||
set -- $PKGLINE
|
set -- $PKGLINE
|
||||||
echo "== Specfile updated from version $2-$6 to $SPEC_VERSION-$SPEC_RELEASE"
|
echo "?= Specfile updated from version $2-$6 to $SPEC_VERSION-$SPEC_RELEASE"
|
||||||
if [ "`echo $SPEC_VERSION | grep -i alpha`" -o \
|
if [ "`echo $SPEC_VERSION | grep -i alpha`" -o \
|
||||||
"`echo $SPEC_VERSION | grep -i beta`" -o \
|
"`echo $SPEC_VERSION | grep -i beta`" -o \
|
||||||
"`echo $SPEC_VERSION | grep -i rc`" -o \
|
"`echo $SPEC_VERSION | grep -i rc`" -o \
|
||||||
@ -880,29 +907,28 @@ if [ "$do_autobuild" = "1" ]; then
|
|||||||
sed -i "/^$PKGNAME /d" $SUCCESSLISTDIR/*.success
|
sed -i "/^$PKGNAME /d" $SUCCESSLISTDIR/*.success
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check skippedlist
|
# check skippedlist
|
||||||
SKIPPEDLINE=`awk '{ print $1" "$2 }' $SKIPPEDLISTDIR/*.skip | grep -m1 "^$PKGNAME "`
|
SKIPPEDLINE=`awk '{ print $1" "$2 }' $SKIPPEDLISTDIR/*.skip | grep -m1 "^$PKGNAME "`
|
||||||
if [ "$SKIPPEDLINE" ]; then
|
if [ "$SKIPPEDLINE" ]; then
|
||||||
set -- $SKIPPEDLINE
|
set -- $SKIPPEDLINE
|
||||||
SKIPPEDTIME=$2
|
SKIPPEDTIME=$2
|
||||||
SKIPPEDDAYS=`expr \( $DATE_NOW - $SKIPPEDTIME \) / 86400`
|
SKIPPEDDAYS=`expr \( $DATE_NOW - $SKIPPEDTIME \) / 86400`
|
||||||
if [ "$SKIPPEDDAYS" -le "$AUTOBUILD_SKIP_DAYS" ]; then
|
if [ "$SKIPPEDDAYS" -le "$AUTOBUILD_SKIP_DAYS" ]; then
|
||||||
SKIPPEDCOUNT=`expr $SKIPPEDCOUNT + 1`
|
SKIPPEDCOUNT=`expr $SKIPPEDCOUNT + 1`
|
||||||
# echo "?= Package $PKGNAME has been in the skippedlist for $SKIPPEDDAYS days; skipping"
|
# echo "?= Package $PKGNAME has been in the skippedlist for $SKIPPEDDAYS days; skipping"
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
sed -i "/^$PKGNAME /d" $SKIPPEDLISTDIR/*.skip
|
sed -i "/^$PKGNAME /d" $SKIPPEDLISTDIR/*.skip
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check legacylist
|
# check legacylist
|
||||||
awk '{ print $1 }' $LEGACYLIST | grep "^$PKGNAME$" >/dev/null && {
|
awk '{ print $1 }' $LEGACYLIST | grep "^$PKGNAME$" >/dev/null && {
|
||||||
echo "?= Job $PKGNAME is in the legacy list; skipping automatic update"
|
echo "?= Job $PKGNAME is in the legacy list; skipping automatic update"
|
||||||
echo "$PKGNAME $DATE_NOW 100" >> $SKIPPEDLISTDIR/auto.skip
|
echo "$PKGNAME $DATE_NOW 100" >> $SKIPPEDLISTDIR/auto.skip
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $AUTOBUILD_NUMADDED -ge $AUTOBUILD_MAXNUM ]; then
|
if [ $AUTOBUILD_NUMADDED -ge $AUTOBUILD_MAXNUM ]; then
|
||||||
@ -913,7 +939,7 @@ if [ "$do_autobuild" = "1" ]; then
|
|||||||
fi
|
fi
|
||||||
done < $srctmpfile
|
done < $srctmpfile
|
||||||
|
|
||||||
echo "%% Total pkgs: $PKGCOUNT, skipped list: $SKIPPEDCOUNT, blacklist: $BLACKLISTCOUNT, success list: $SUCCESSLISTCOUNT"
|
echo "%% Total pkgs: $PKGCOUNT, skipped list: $SKIPPEDCOUNT, blacklist: $BLACKLISTCOUNT, success list: $SUCCESSLISTCOUNT, last build date: $BUILDDATE"
|
||||||
while read line; do
|
while read line; do
|
||||||
set -- $line
|
set -- $line
|
||||||
PKGNAME=${1}
|
PKGNAME=${1}
|
||||||
@ -1011,7 +1037,7 @@ for JOB_NUM in `seq 1 ${#JOBNAME[*]}`; do
|
|||||||
if [ ! "$rebuild_packages" -a "${JOB_VER}" != "+0" ]; then
|
if [ ! "$rebuild_packages" -a "${JOB_VER}" != "+0" ]; then
|
||||||
[ $ret -ge 2 -a "$do_autobuild" ] && {
|
[ $ret -ge 2 -a "$do_autobuild" ] && {
|
||||||
echo "%% Adding $JOB_NAME job to skipped list."
|
echo "%% Adding $JOB_NAME job to skipped list."
|
||||||
echo "$JOB_NAME $DATE_NOW $?" >> $SKIPPEDLISTDIR/auto.skip
|
echo "$JOB_NAME $DATE_NOW $ret" >> $SKIPPEDLISTDIR/auto.skip
|
||||||
}
|
}
|
||||||
case $SEVERITY in
|
case $SEVERITY in
|
||||||
0) ;;
|
0) ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user