Factor out the iso filename to reduce repetition and bugs

This commit is contained in:
Steve McIntyre 2011-03-24 11:59:53 +00:00
parent 89f878a8de
commit b24974e5d0
1 changed files with 21 additions and 19 deletions

View File

@ -147,46 +147,48 @@ make_cd () {
mkdir -p $OUT/$THISARCH/list-$TYPE mkdir -p $OUT/$THISARCH/list-$TYPE
fi fi
BASENAME="debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM"
${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \ ${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \
$OUT/$THISARCH/iso-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso \ $OUT/$THISARCH/iso-$TYPE/${BASENAME}.iso \
-jigdo-jigdo $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo \ -jigdo-jigdo $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo \
-jigdo-template $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.template \ -jigdo-template $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.template \
-jigdo-map Debian=$MIRROR/ \ -jigdo-map Debian=$MIRROR/ \
-jigdo-force-md5 /pool/ \ -jigdo-force-md5 /pool/ \
-md5-list $UPD/md5-check \ -md5-list $UPD/md5-check \
$UPD/CD$CDNUM 2>&1 | grep "extents written" $UPD/CD$CDNUM 2>&1 | grep "extents written"
$BASEDIR/tools/jigdo_cleanup \ $BASEDIR/tools/jigdo_cleanup \
$OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo \ $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo \
debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso \ ${BASENAME}.iso \
$OUT debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.template \ $OUT ${BASENAME}.template \
"Debian GNU/Linux $VER - $OFFICIAL $THISARCH $FIRSTVER->$VER update $TYPEUP #$THISNUM" "Debian GNU/Linux $VER - $OFFICIAL $THISARCH $FIRSTVER->$VER update $TYPEUP #$THISNUM"
echo $SNAPSHOT >> $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo echo $SNAPSHOT >> $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo
# Make sure that the ISO is as new/newer than the jigdo file; #587774 # Make sure that the ISO is as new/newer than the jigdo file; #587774
touch $OUT/$THISARCH/iso-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso touch $OUT/$THISARCH/iso-$TYPE/${BASENAME}.iso
MD5=`cat $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo | \ MD5=`cat $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo | \
awk '/Image Hex MD5Sum/ {print $5}'` awk '/Image Hex MD5Sum/ {print $5}'`
echo "$MD5 debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso" >> $OUT/$THISARCH/jigdo-$TYPE/MD5SUMS.update echo "$MD5 ${BASENAME}.iso" >> $OUT/$THISARCH/jigdo-$TYPE/MD5SUMS.update
echo "$MD5 debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso" >> $OUT/$THISARCH/iso-$TYPE/MD5SUMS.update echo "$MD5 ${BASENAME}.iso" >> $OUT/$THISARCH/iso-$TYPE/MD5SUMS.update
for SHA_SIZE in 1 256 512; do for SHA_SIZE in 1 256 512; do
SHA=`cat $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo | \ SHA=`cat $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo | \
awk "/Image Hex SHA${SHA_SIZE}Sum/ {print \\$5}"` awk "/Image Hex SHA${SHA_SIZE}Sum/ {print \\$5}"`
if [ "$SHA"x = ""x ] ; then if [ "$SHA"x = ""x ] ; then
echo "SHA fail" echo "SHA fail"
exit 1 exit 1
fi fi
echo "$SHA debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso" >> $OUT/$THISARCH/jigdo-$TYPE/SHA${SHA_SIZE}SUMS.update echo "$SHA ${BASENAME}.iso" >> $OUT/$THISARCH/jigdo-$TYPE/SHA${SHA_SIZE}SUMS.update
echo "$SHA debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso" >> $OUT/$THISARCH/iso-$TYPE/SHA${SHA_SIZE}SUMS.update echo "$SHA ${BASENAME}.iso" >> $OUT/$THISARCH/iso-$TYPE/SHA${SHA_SIZE}SUMS.update
done done
gzip -9 $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo gzip -9 $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo
mv $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo.gz \ mv $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo.gz \
$OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo $OUT/$THISARCH/jigdo-$TYPE/${BASENAME}.jigdo
else else
${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \ ${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \
$OUT/iso-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso \ $OUT/iso-$TYPE/${BASENAME}.iso \
$UPD/CD$CDNUM 2>&1 | grep "extents written" $UPD/CD$CDNUM 2>&1 | grep "extents written"
fi fi
find $UPD/CD$CDNUM/pool -type f | sed 's?^.*/??g' | gzip -9 > $OUT/$THISARCH/list-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.list.gz find $UPD/CD$CDNUM/pool -type f | sed 's?^.*/??g' | gzip -9 > $OUT/$THISARCH/list-$TYPE/${BASENAME}.list.gz
} }
add_file () { add_file () {