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,\..*$,,')
12 if [ ! -e $file ] && [ -e $file.proc ]; then
15 if [ ! -e $file ]; then
16 echo "Ignoring non-existent $file"
19 BASE=$(basename $file .proc)
20 PKG_VER_ARCH=$(cat $file)
21 PKG=$(echo $PKG_VER_ARCH | cut -d _ -f1)
22 VER=$(echo $PKG_VER_ARCH | cut -d _ -f2)
23 ARCH=$(echo $PKG_VER_ARCH | cut -d _ -f3)
24 if [ -f ${LOGS}/${ARCH}/PASS/${PKG}_${VER}_${ARCH}.log ]; then
25 echo "Ignoring successfully-built $file: $PKG_VER_ARCH"
28 if [ -f ${LOGS}/${ARCH}/FAIL/${PKG}_${VER}_${ARCH}.log ]; then
29 echo "Ignoring failed $file: $PKG_VER_ARCH"
32 # echo "Original build attempt source-failed for $file: $PKG_VER_ARCH"
33 echo " Old version was $VER"
34 echo " Checking what version now exists"
35 NEW_VER=$(zcat $SOURCES | grep-dctrl -S -X ${PKG} -s version | awk '{print $2}' | tail -1)
36 if [ "$NEW_VER"x = ""x ]; then
37 echo " Can't find any version for $PKG now, giving up"
39 if [ "$NEW_VER"x = "$VER"x ]; then
40 echo " Same version still exists!"
41 if [ -f ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log ]; then
42 echo " Moving old log file to one side"
43 mv ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log.1
45 echo " And requeueing"
47 echo "${PKG}_${VER}_${ARCH}" > $BASE.q
49 echo " Version moved from $VER to $NEW_VER"
50 echo " Deleting old log file"
51 rm -f ${LOGS}/${ARCH}/FAIL_SOURCE/${PKG}_${VER}_${ARCH}.log
52 echo " And queueing new version"
53 MAX_BUILD_NUM=$(($MAX_BUILD_NUM + 1))
54 echo "${PKG}_${NEW_VER}_${ARCH}" > ${MAX_BUILD_NUM}.q
55 ls -l ${MAX_BUILD_NUM}.q