3 # Helper script to requeue a build that has failed, due to missing
4 # source, missing build-deps etc.
8 SOURCES=/mirror/debian/dists/unstable/main/source/Sources.gz
9 MAX_BUILD_NUM=$(ls -1 $IN | tail -1 | sed 's,\..*$,,')
14 if [ ! -e $file ] && [ -e $file.proc ]; then
17 if [ ! -e $file ]; then
18 echo "Ignoring non-existent $file"
21 BASE=$(basename $file .proc)
22 PKG_VER_ARCH=$(cat $file)
23 PKG=$(echo $PKG_VER_ARCH | cut -d _ -f1)
24 VER=$(echo $PKG_VER_ARCH | cut -d _ -f2)
25 ARCH=$(echo $PKG_VER_ARCH | cut -d _ -f3)
26 if [ -f ${LOGS}/${ARCH}/PASS/${PKG}_${VER}_${ARCH}.log ]; then
27 echo "Ignoring successfully-built $file: $PKG_VER_ARCH"
30 if [ -f ${LOGS}/${ARCH}/FAIL/${PKG}_${VER}_${ARCH}.log ]; then
31 echo "Ignoring failed $file: $PKG_VER_ARCH"
34 # echo "Original build attempt source-failed for $file: $PKG_VER_ARCH"
35 echo " Old version was $VER"
36 echo " Checking what version now exists"
37 NEW_VER=$(zcat $SOURCES | grep-dctrl -S -X ${PKG} -s version | awk '{print $2}' | tail -1)
38 if [ "$NEW_VER"x = ""x ]; then
39 echo " Can't find any version for $PKG now, giving up"
41 if [ "$NEW_VER"x = "$VER"x ]; then
42 echo " Same version still exists!"
43 if [ -f ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log ]; then
44 echo " Moving old log file to one side"
45 mv ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log.1
47 echo " And requeueing"
49 echo "${PKG}_${VER}_${ARCH}" > $BASE.q
51 echo " Version moved from $VER to $NEW_VER"
52 echo " Deleting old log file"
53 rm -f ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log
54 echo " And queueing new version"
55 MAX_BUILD_NUM=$(($MAX_BUILD_NUM + 1))
56 echo "${PKG}_${NEW_VER}_${ARCH}" > ${MAX_BUILD_NUM}.q
57 ls -l ${MAX_BUILD_NUM}.q