merge update-cd changes back from trunk again
This commit is contained in:
parent
b3f1215003
commit
c1b1de8ce0
|
@ -53,14 +53,14 @@ else
|
||||||
fi
|
fi
|
||||||
case $TYPE in
|
case $TYPE in
|
||||||
cd|CD)
|
cd|CD)
|
||||||
TYPE=cd
|
TYPE=cd
|
||||||
TYPEUP=CD;;
|
TYPEUP=CD;;
|
||||||
dvd|DVD)
|
dvd|DVD)
|
||||||
TYPE=dvd
|
TYPE=dvd
|
||||||
TYPEUP=DVD;;
|
TYPEUP=DVD;;
|
||||||
*)
|
*)
|
||||||
echo "Specify a disk type..."
|
echo "Specify a disk type..."
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Location of the diff file to use to determine the changes. If you leave
|
# Location of the diff file to use to determine the changes. If you leave
|
||||||
|
@ -110,11 +110,11 @@ copy_file () {
|
||||||
mkdir -p $ROOTDIR/$DIR
|
mkdir -p $ROOTDIR/$DIR
|
||||||
fi
|
fi
|
||||||
if [ -e $MIRROR/$FILE ] ; then
|
if [ -e $MIRROR/$FILE ] ; then
|
||||||
cp -l $MIRROR/$FILE $ROOTDIR/$FILE
|
cp -l $MIRROR/$FILE $ROOTDIR/$FILE
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "File $FILE not found!"
|
echo "File $FILE not found!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,80 +136,89 @@ make_cd () {
|
||||||
$create_control CD$CDNUM $THISARCH
|
$create_control CD$CDNUM $THISARCH
|
||||||
echo " Creating image for CD$CDNUM ($SRCFILES source files, $ARCHFILES $ARCH debs, $ALLFILES all debs)"
|
echo " Creating image for CD$CDNUM ($SRCFILES source files, $ARCHFILES $ARCH debs, $ALLFILES all debs)"
|
||||||
echo -n " "
|
echo -n " "
|
||||||
if [ ! -d $OUT/$THISARCH/iso-$TYPE ] ; then
|
|
||||||
mkdir -p $OUT/$THISARCH/iso-$TYPE
|
|
||||||
fi
|
|
||||||
if [ $JTE = 1 ] ; then
|
|
||||||
if [ ! -d $OUT/$THISARCH/jigdo-$TYPE ] ; then
|
|
||||||
mkdir -p $OUT/$THISARCH/jigdo-$TYPE
|
|
||||||
fi
|
|
||||||
${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \
|
|
||||||
$OUT/$THISARCH/iso-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso \
|
|
||||||
-jigdo-jigdo $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo \
|
|
||||||
-jigdo-template $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.template \
|
|
||||||
-jigdo-map Debian=$MIRROR/ \
|
|
||||||
-jigdo-force-md5 /pool/ \
|
|
||||||
-md5-list $UPD/md5-check \
|
|
||||||
$UPD/CD$CDNUM 2>&1 | grep "extents written"
|
|
||||||
$BASEDIR/tools/jigdo_cleanup \
|
|
||||||
$OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo \
|
|
||||||
debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso \
|
|
||||||
$OUT debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.template \
|
|
||||||
"Debian GNU/Linux $VER - $OFFICIAL $THISARCH $FIRSTVER->$VER update $TYPEUP #$THISNUM"
|
|
||||||
echo $SNAPSHOT >> $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo
|
|
||||||
# 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
|
|
||||||
|
|
||||||
MD5=`cat $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo | \
|
BASENAME="debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM"
|
||||||
awk '/Image Hex MD5Sum/ {print $5}'`
|
ISODIR=$OUT/$THISARCH/iso-$TYPE
|
||||||
echo "$MD5 debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso" >> $OUT/$THISARCH/jigdo-$TYPE/MD5SUMS.update
|
JIGDODIR=$OUT/$THISARCH/jigdo-$TYPE
|
||||||
echo "$MD5 debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.iso" >> $OUT/$THISARCH/iso-$TYPE/MD5SUMS.update
|
LISTDIR=$OUT/$THISARCH/list-$TYPE
|
||||||
for SHA_SIZE in 1 256 512; do
|
|
||||||
SHA=`cat $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo | \
|
if [ ! -d ${ISODIR} ] ; then
|
||||||
awk "/Image Hex SHA${SHA_SIZE}Sum/ {print \\$5}"`
|
mkdir -p ${ISODIR}
|
||||||
if [ "$SHA"x = ""x ] ; then
|
|
||||||
echo "SHA fail"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "$SHA debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.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
|
|
||||||
done
|
|
||||||
gzip -9 $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo
|
|
||||||
mv $OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo.gz \
|
|
||||||
$OUT/$THISARCH/jigdo-$TYPE/debian-update-$VER-$THISARCH-$TYPEUP-$THISNUM.jigdo
|
|
||||||
else
|
|
||||||
${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \
|
|
||||||
$OUT/iso-$TYPE/$CODENAME-update-$THISARCH-$TYPEUP-$THISNUM.iso \
|
|
||||||
$UPD/CD$CDNUM 2>&1 | grep "extents written"
|
|
||||||
fi
|
fi
|
||||||
|
if [ $JTE = 1 ] && [ ! -d ${JIGDODIR} ] ; then
|
||||||
|
mkdir -p ${JIGDODIR}
|
||||||
|
fi
|
||||||
|
if [ ! -d ${LISTDIR} ] ; then
|
||||||
|
mkdir -p ${LISTDIR}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $JTE = 1 ] ; then
|
||||||
|
${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \
|
||||||
|
${ISODIR}/${BASENAME}.iso \
|
||||||
|
-jigdo-jigdo ${JIGDODIR}/${BASENAME}.jigdo \
|
||||||
|
-jigdo-template ${JIGDODIR}/${BASENAME}.template \
|
||||||
|
-jigdo-map Debian=$MIRROR/ \
|
||||||
|
-jigdo-force-md5 /pool/ \
|
||||||
|
-md5-list $UPD/md5-check \
|
||||||
|
$UPD/CD$CDNUM 2>&1 | grep "extents written"
|
||||||
|
$BASEDIR/tools/jigdo_cleanup \
|
||||||
|
${JIGDODIR}/${BASENAME}.jigdo \
|
||||||
|
${BASENAME}.iso \
|
||||||
|
$OUT ${BASENAME}.template \
|
||||||
|
"Debian GNU/Linux $VER - $OFFICIAL $THISARCH $FIRSTVER->$VER update $TYPEUP #$THISNUM"
|
||||||
|
echo $SNAPSHOT >> ${JIGDODIR}/${BASENAME}.jigdo
|
||||||
|
# Make sure that the ISO is as new/newer than the jigdo file; #587774
|
||||||
|
touch ${ISODIR}/${BASENAME}.iso
|
||||||
|
|
||||||
|
MD5=`cat ${JIGDODIR}/${BASENAME}.jigdo | \
|
||||||
|
awk '/Image Hex MD5Sum/ {print $5}'`
|
||||||
|
echo "$MD5 ${BASENAME}.iso" >> ${JIGDODIR}/MD5SUMS.update
|
||||||
|
echo "$MD5 ${BASENAME}.iso" >> ${ISODIR}/MD5SUMS.update
|
||||||
|
for SHA_SIZE in 1 256 512; do
|
||||||
|
SHA=`cat ${JIGDODIR}/${BASENAME}.jigdo | \
|
||||||
|
awk "/Image Hex SHA${SHA_SIZE}Sum/ {print \\$5}"`
|
||||||
|
if [ "$SHA"x = ""x ] ; then
|
||||||
|
echo "SHA fail"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "$SHA ${BASENAME}.iso" >> ${JIGDODIR}/SHA${SHA_SIZE}SUMS.update
|
||||||
|
echo "$SHA ${BASENAME}.iso" >> ${ISODIR}/SHA${SHA_SIZE}SUMS.update
|
||||||
|
done
|
||||||
|
gzip -9 ${JIGDODIR}/${BASENAME}.jigdo
|
||||||
|
mv ${JIGDODIR}/${BASENAME}.jigdo.gz ${JIGDODIR}/${BASENAME}.jigdo
|
||||||
|
else
|
||||||
|
${MKISOFS} -J -r -V "Debian $VER update $TYPEUP" -o \
|
||||||
|
$OUT/iso-$TYPE/${BASENAME}.iso \
|
||||||
|
$UPD/CD$CDNUM 2>&1 | grep "extents written"
|
||||||
|
fi
|
||||||
|
find $UPD/CD$CDNUM/pool -type f | sed 's?^.*/??g' | gzip -9 > ${LISTDIR}/${BASENAME}.list.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
add_file () {
|
add_file () {
|
||||||
file=$1
|
file=$1
|
||||||
case "$THISARCH" in
|
case "$THISARCH" in
|
||||||
source)
|
source)
|
||||||
case "$file" in
|
case "$file" in
|
||||||
*.gz|*.bz2|*.dsc)
|
*.gz|*.bz2|*.dsc)
|
||||||
copy_file $UPD/CD$CDNUM $file
|
|
||||||
SRCFILES=$(($SRCFILES + 1))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo -en "\r$SRCFILES copied"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
case "$file" in
|
|
||||||
*_$THISARCH.deb)
|
|
||||||
copy_file $UPD/CD$CDNUM $file
|
copy_file $UPD/CD$CDNUM $file
|
||||||
ARCHFILES=$(($ARCHFILES + 1))
|
SRCFILES=$(($SRCFILES + 1))
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
echo -en "\r$SRCFILES copied"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
case "$file" in
|
||||||
|
*_$THISARCH.deb)
|
||||||
|
copy_file $UPD/CD$CDNUM $file
|
||||||
|
ARCHFILES=$(($ARCHFILES + 1))
|
||||||
|
;;
|
||||||
*_all.deb)
|
*_all.deb)
|
||||||
copy_file $UPD/CD$CDNUM $file
|
copy_file $UPD/CD$CDNUM $file
|
||||||
ALLFILES=$(($ALLFILES + 1))
|
ALLFILES=$(($ALLFILES + 1))
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo -en "\r$THISARCH:$ARCHFILES all:$ALLFILES copied"
|
echo -en "\r$THISARCH:$ARCHFILES all:$ALLFILES copied"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,50 +249,50 @@ do
|
||||||
|
|
||||||
MIRROR=$MIRROR_NORM
|
MIRROR=$MIRROR_NORM
|
||||||
|
|
||||||
rm -rf $OUT/$THISARCH/iso-$TYPE $OUT/$THISARCH/jigdo-$TYPE
|
rm -rf $OUT/$THISARCH/*-$TYPE
|
||||||
|
|
||||||
for file in `cat $UPD/list`
|
for file in `cat $UPD/list`
|
||||||
do
|
do
|
||||||
if [ ! -d $UPD/CD$CDNUM ] ; then
|
if [ ! -d $UPD/CD$CDNUM ] ; then
|
||||||
echo
|
echo
|
||||||
cd $MIRROR
|
cd $MIRROR
|
||||||
THISNUM=$((THISNUM + 1))
|
THISNUM=$((THISNUM + 1))
|
||||||
if [ $THISARCH = "source" ] ; then
|
if [ $THISARCH = "source" ] ; then
|
||||||
echo "Creating $TYPEUP$CDNUM for source (part $THISNUM)"
|
echo "Creating $TYPEUP$CDNUM for source (part $THISNUM)"
|
||||||
else
|
else
|
||||||
echo "Creating $TYPEUP$CDNUM for binary-$THISARCH (part $THISNUM)"
|
echo "Creating $TYPEUP$CDNUM for binary-$THISARCH (part $THISNUM)"
|
||||||
fi
|
fi
|
||||||
mkdir $UPD/CD$CDNUM $UPD/CD$CDNUM/.disk
|
mkdir $UPD/CD$CDNUM $UPD/CD$CDNUM/.disk
|
||||||
INFO="Debian GNU/Linux $VER Update $TYPEUP $DATE: $THISARCH $TYPEUP $THISNUM"
|
INFO="Debian GNU/Linux $VER Update $TYPEUP $DATE: $THISARCH $TYPEUP $THISNUM"
|
||||||
echo $INFO > $UPD/CD$CDNUM/.disk/info
|
echo $INFO > $UPD/CD$CDNUM/.disk/info
|
||||||
SIZE_USED=0
|
SIZE_USED=0
|
||||||
SRCFILES=0
|
SRCFILES=0
|
||||||
ARCHFILES=0
|
ARCHFILES=0
|
||||||
ALLFILES=0
|
ALLFILES=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$BACKOUT_FILE"x != ""x ] ; then
|
if [ "$BACKOUT_FILE"x != ""x ] ; then
|
||||||
echo "Starting with backed-out file $BACKOUT_FILE"
|
echo "Starting with backed-out file $BACKOUT_FILE"
|
||||||
add_file $BACKOUT_FILE
|
add_file $BACKOUT_FILE
|
||||||
BACKOUT_FILE=""
|
BACKOUT_FILE=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
add_file $file
|
add_file $file
|
||||||
|
|
||||||
SIZE_USED=`du -sk $UPD/CD$CDNUM | awk '{print $1}'`
|
SIZE_USED=`du -sk $UPD/CD$CDNUM | awk '{print $1}'`
|
||||||
if [ $SIZE_USED -gt $CDSIZE ] ; then
|
if [ $SIZE_USED -gt $CDSIZE ] ; then
|
||||||
# Back out the last file added
|
# Back out the last file added
|
||||||
size=`stat -c %s $UPD/CD$CDNUM/$file`
|
size=`stat -c %s $UPD/CD$CDNUM/$file`
|
||||||
rm -f $UPD/CD$CDNUM/$file
|
rm -f $UPD/CD$CDNUM/$file
|
||||||
echo
|
echo
|
||||||
echo " Overfull: back out $file ($size bytes)"
|
echo " Overfull: back out $file ($size bytes)"
|
||||||
DIR=`dirname $file`
|
DIR=`dirname $file`
|
||||||
rmdir $DIR > /dev/null 2>&1 || true
|
rmdir $DIR > /dev/null 2>&1 || true
|
||||||
BACKOUT_FILE=$file
|
BACKOUT_FILE=$file
|
||||||
make_cd $CDNUM $THISNUM $THISARCH $SRCFILES $ARCHFILES $ALLFILES
|
make_cd $CDNUM $THISNUM $THISARCH $SRCFILES $ARCHFILES $ALLFILES
|
||||||
CDNUM=$(($CDNUM + 1))
|
CDNUM=$(($CDNUM + 1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
make_cd $CDNUM $THISNUM $THISARCH $SRCFILES $ARCHFILES $ALLFILES
|
make_cd $CDNUM $THISNUM $THISARCH $SRCFILES $ARCHFILES $ALLFILES
|
||||||
|
|
Loading…
Reference in New Issue