Skip to content
Snippets Groups Projects

[LOS-623] add feature to bsdownload to wait until a build has finished before attempting download

Merged [LOS-623] add feature to bsdownload to wait until a build has finished before attempting download
Merged Ben Morrice requested to merge los623 into master
1 file
+ 30
9
Compare changes
  • Side-by-side
  • Inline
+ 30
9
@@ -12,6 +12,7 @@ OPTIONS:
-d Distribution: slc5 slc6
-r Repository: updates
-s Sign packages
-w Wait for packages to be built in koji
-x num Download only the "num" package for each repo/dist specified
EOF
}
@@ -48,7 +49,7 @@ optiond=false
optionr=false
optionx=false
while getopts “:hbnsad:r:x:” OPTION
while getopts “:hbnswad:r:x:” OPTION
do
case $OPTION in
h)
@@ -77,6 +78,8 @@ do
s)
SIGN=1
;;
w) WAIT=1
;;
x)
optionx=true
MAX=$OPTARG
@@ -173,25 +176,43 @@ do
tput sgr0
mv -f $PKG $RESULTS/$DIST/$REPO/
else
case `build_status $NAME` in
COMPLETE)
if [ $WAIT ]; then
COUNT=20
else
COUNT=1
fi
for i in `seq 1 $COUNT`
do
case `build_status $NAME` in
COMPLETE)
echo -e $VERT " -> Package [$NAME] downloading..."
tput sgr0
koji_download_all $NAME $RESULTS/$DIST/$REPO/
mv -f $PKG $RESULTS/$DIST/$REPO/SRPMS
chmod -R g+rw $RESULTS/$DIST/$REPO/
continue
;;
FAILED|CANCELED|"")
FAILED|CANCELED|"")
echo -e $ROUGE "-> Package [$NAME] failed."
tput sgr0
continue
continue 2
;;
*)
*)
echo -e $JAUNE "-> Package [$NAME] still building..."
tput sgr0
continue
;;
esac
if [ $WAIT ]; then
if [ $i -eq $COUNT ]; then
echo -e $JAUNE "-> Package [$NAME] failed to build in time..."
continue 2
fi
echo -e $JAUNE "-> Waiting for package [$NAME] to be built [$i/$COUNT minutes]..."
sleep 60
else
continue
fi
;;
esac
done
fi
echo " -> Remove src.rpm"
rm $RESULTS/$DIST/$REPO/*.src.rpm 2>/dev/null
Loading