2000-12-05 19:53:24 -01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2001-05-25 00:02:55 +00:00
|
|
|
# $Id$
|
2000-12-05 19:53:24 -01:00
|
|
|
#
|
|
|
|
# (c) Steve McIntyre <stevem@chiark.greenend.org.uk> Released under
|
2001-02-07 10:08:22 -01:00
|
|
|
# GNU GPL v2 1st January 2001
|
2000-12-05 19:53:24 -01:00
|
|
|
#
|
|
|
|
# Quick and dirty script to create update CDs for people to upgrade
|
|
|
|
# from potato (2.2r0) to the latest release level
|
2001-02-07 10:08:22 -01:00
|
|
|
#
|
2000-12-05 19:53:24 -01:00
|
|
|
# Configuration goes here.
|
|
|
|
# Where is your mirror?
|
2001-05-25 00:02:55 +00:00
|
|
|
MIRROR=${MIRROR:-/mirror/debian}
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# If you have a non-US mirror, where is it? Leave blank if you don't have one.
|
|
|
|
NONUS=${NONUS:-$MIRROR/non-US}
|
|
|
|
|
|
|
|
# Do you want non-free? 1 for yes, 0 for no
|
|
|
|
NONFREE=1
|
|
|
|
|
|
|
|
# What release version is this?
|
2001-04-27 22:44:58 +00:00
|
|
|
VER=2.2r3
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# Path to use with mkisofs/mkhybrid
|
|
|
|
MKISOFS=${MKISOFS:-"mkhybrid"}
|
|
|
|
|
|
|
|
# The working directory to use. MUST be on the same partition as the mirror.
|
2001-05-25 00:02:55 +00:00
|
|
|
TDIR=/mirror/debian-cd
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# Building potato cd set ...
|
|
|
|
CODENAME=potato
|
|
|
|
|
|
|
|
# Path where the images will be written
|
2001-05-25 00:02:55 +00:00
|
|
|
OUT=/mirror/debian-cd
|
2000-12-05 19:53:24 -01:00
|
|
|
|
2001-02-07 10:08:22 -01:00
|
|
|
# Location of the diff file to use to determine the changes. If you leave
|
|
|
|
# this blank, we'll try to determine the changes from the ChangeLog files,
|
|
|
|
# which is probably less accurate.
|
2001-05-25 00:02:55 +00:00
|
|
|
DIFF=/mirror/lists/r0-r3.diff #~/r2.diff
|
2001-02-07 10:08:22 -01:00
|
|
|
|
2000-12-05 19:53:24 -01:00
|
|
|
REL=Debian"$VER"
|
2001-04-27 22:44:58 +00:00
|
|
|
CLOG=dists/potato/ChangeLog
|
|
|
|
NUCLOG=dists/potato/non-US/ChangeLog
|
2000-12-05 19:53:24 -01:00
|
|
|
UPD=$TDIR/potato-update
|
|
|
|
DATE=`date +%Y%m%d`
|
|
|
|
BASEDIR=`pwd`
|
|
|
|
INFO1="Debian GNU/Linux $VER Update CD $DATE for Alpha, Arm and i386"
|
|
|
|
INFO2="Debian GNU/Linux $VER Update CD $DATE for M68k, PowerPC and Sparc"
|
2001-05-25 00:02:55 +00:00
|
|
|
INFO3="Debian GNU/Linux $VER Update CD $DATE source"
|
2000-12-05 19:53:24 -01:00
|
|
|
ARCH1="alpha arm i386"
|
|
|
|
ARCH2="m68k powerpc sparc"
|
|
|
|
|
|
|
|
export TDIR NONFREE NONUS VER MIRROR CODENAME OUT BASEDIR
|
|
|
|
|
|
|
|
scanpackages=$BASEDIR/tools/scanpackages
|
|
|
|
scansources=$BASEDIR/tools/scansources
|
|
|
|
set_mkisofs_opts=$BASEDIR/tools/set_mkisofs_opts
|
|
|
|
adddirs=$BASEDIR/tools/add_dirs
|
2001-02-07 10:08:22 -01:00
|
|
|
addfiles=$BASEDIR/tools/add_files
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
echo Cleaning up
|
|
|
|
rm -rf $UPD
|
2001-05-25 00:02:55 +00:00
|
|
|
mkdir $UPD $UPD/CD1 $UPD/CD2 $UPD/CD3
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
echo Creating directory trees
|
|
|
|
for ARCH in $ARCH1
|
|
|
|
do
|
|
|
|
export ARCH
|
|
|
|
$adddirs $UPD/CD1
|
|
|
|
done
|
|
|
|
|
|
|
|
for ARCH in $ARCH2
|
|
|
|
do
|
|
|
|
export ARCH
|
|
|
|
$adddirs $UPD/CD2
|
|
|
|
done
|
|
|
|
|
2001-05-25 00:02:55 +00:00
|
|
|
$adddirs $UPD/CD3
|
|
|
|
|
2000-12-05 19:53:24 -01:00
|
|
|
cd $MIRROR
|
|
|
|
|
|
|
|
echo Creating main-section list
|
|
|
|
|
2001-02-07 10:08:22 -01:00
|
|
|
if [ -e $DIFF ] ; then
|
2001-04-27 22:44:58 +00:00
|
|
|
grep -v non-US $DIFF >$UPD/list
|
2001-05-25 00:02:55 +00:00
|
|
|
egrep -e \\.deb$ $UPD/list >$UPD/bin-list
|
|
|
|
egrep -e ^dists.*\\.gz$ -e ^dists.*\\.dsc$ $UPD/list >$UPD/src-list
|
2001-02-07 10:08:22 -01:00
|
|
|
else
|
2001-05-25 00:02:55 +00:00
|
|
|
egrep -e ^dists.*\\.deb$ $CLOG >$UPD/bin-list
|
|
|
|
egrep -e ^dists.*\\.gz$ -e ^dists.*\\.dsc$ $CLOG >$UPD/src-list
|
2001-02-07 10:08:22 -01:00
|
|
|
fi
|
2000-12-05 19:53:24 -01:00
|
|
|
if [ "$NONFREE"x != "1"x ] ; then
|
|
|
|
echo Removing non-free
|
2001-05-25 00:02:55 +00:00
|
|
|
grep -v non-free $UPD/bin-list > $UPD/bin-list1
|
|
|
|
mv -f $UPD/bin-list1 $UPD/bin-list
|
|
|
|
grep -v non-free $UPD/src-list > $UPD/src-list1
|
|
|
|
mv -f $UPD/src-list1 $UPD/src-list
|
2000-12-05 19:53:24 -01:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo Creating trees
|
2001-05-25 00:02:55 +00:00
|
|
|
cat $UPD/bin-list | xargs $addfiles $UPD/CD1 $MIRROR
|
|
|
|
cat $UPD/bin-list | xargs $addfiles $UPD/CD2 $MIRROR
|
|
|
|
cat $UPD/src-list | xargs $addfiles $UPD/CD3 $MIRROR
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
if [ "$NONUS"x != ""x ] ; then
|
|
|
|
echo Creating non-US list
|
|
|
|
cd $NONUS
|
2001-02-07 10:08:22 -01:00
|
|
|
if [ -e $DIFF ] ; then
|
2001-04-27 22:44:58 +00:00
|
|
|
grep non-US $DIFF >$UPD/nu-list
|
2001-05-25 00:02:55 +00:00
|
|
|
egrep -e \\.deb$ $UPD/nu-list >$UPD/bin-nu-list
|
|
|
|
egrep -e ^dists.*\\.gz$ -e ^dists.*\\.dsc$ $UPD/nu-list >$UPD/src-nu-list
|
2001-02-07 10:08:22 -01:00
|
|
|
else
|
2001-05-25 00:02:55 +00:00
|
|
|
egrep -e ^dists.*\\.deb$ $NUCLOG | sed 's?^stable?dists/potato?g' > $UPD/bin-nu-list
|
|
|
|
egrep -e ^dists.*\\.gz$ -e ^dists.*\\.dsc$ $NUCLOG | sed 's?^stable?dists/potato?g' > $UPD/src-nu-list
|
2001-02-07 10:08:22 -01:00
|
|
|
fi
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
if [ "$NONFREE"x != "1"x ] ; then
|
|
|
|
echo Removing non-free
|
2001-05-25 00:02:55 +00:00
|
|
|
grep -v non-free $UPD/bin-nu-list > $UPD/bin-nu-list1
|
|
|
|
mv -f $UPD/bin-nu-list1 $UPD/bin-nu-list
|
|
|
|
grep -v non-free $UPD/src-nu-list > $UPD/src-nu-list1
|
|
|
|
mv -f $UPD/src-nu-list1 $UPD/src-nu-list
|
2000-12-05 19:53:24 -01:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo Creating non-US trees
|
2001-05-25 00:02:55 +00:00
|
|
|
cat $UPD/bin-nu-list | xargs $addfiles $UPD/CD1 $MIRROR
|
|
|
|
cat $UPD/bin-nu-list | xargs $addfiles $UPD/CD2 $MIRROR
|
|
|
|
cat $UPD/src-nu-list | xargs $addfiles $UPD/CD3 $MIRROR
|
2000-12-05 19:53:24 -01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# The full update will not fit on a single CD, so split it by architecture, arbitrarily
|
|
|
|
# CD 1 gets alpha/arm/i386
|
|
|
|
# CD 2 gets m68k/sparc/powerpc
|
2001-05-25 00:02:55 +00:00
|
|
|
# binary-all goes on both
|
|
|
|
# CD 3 gets source
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
cd $UPD
|
|
|
|
|
|
|
|
echo Splitting binary dirs between trees
|
|
|
|
for ARCH in $ARCH2
|
|
|
|
do
|
|
|
|
find CD1 -type d | egrep -e binary-$ARCH$ | xargs rm -r
|
|
|
|
done
|
2001-05-25 00:02:55 +00:00
|
|
|
find CD1 -type d | egrep -e source | xargs rm -r
|
|
|
|
|
2000-12-05 19:53:24 -01:00
|
|
|
for ARCH in $ARCH1
|
|
|
|
do
|
|
|
|
find CD2 -type d | egrep -e binary-$ARCH$ | xargs rm -r
|
|
|
|
done
|
2001-05-25 00:02:55 +00:00
|
|
|
find CD2 -type d | egrep -e source | xargs rm -r
|
|
|
|
|
|
|
|
for ARCH in sparc all
|
|
|
|
do
|
|
|
|
find CD3 -type d | egrep -e binary-$ARCH$ | xargs rm -r
|
|
|
|
done
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# Now create the binary-all symlinks
|
|
|
|
|
|
|
|
echo Creating binary-all symlinks
|
|
|
|
for DIR in `find . -name binary-all`
|
|
|
|
do
|
|
|
|
cd $DIR
|
|
|
|
for CAT in *
|
|
|
|
do
|
|
|
|
if [ $CAT != '*' ] ; then
|
2001-02-07 10:08:22 -01:00
|
|
|
if [ -d $CAT ] ; then
|
|
|
|
cd $CAT
|
|
|
|
fi
|
2000-12-05 19:53:24 -01:00
|
|
|
for FILE in *.deb
|
|
|
|
do
|
|
|
|
if [ $FILE != '*.deb' ] ; then
|
|
|
|
for ARCH in alpha arm i386 m68k powerpc sparc
|
|
|
|
do
|
|
|
|
if [ -d ../../binary-$ARCH ] ; then
|
|
|
|
if [ ! -d ../../binary-$ARCH/$CAT ] ; then
|
|
|
|
mkdir ../../binary-$ARCH/$CAT
|
|
|
|
fi
|
|
|
|
ln -s ../../binary-all/$CAT/$FILE ../../binary-$ARCH/$CAT
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
2001-02-07 10:08:22 -01:00
|
|
|
if [ -d ../$CAT ] ; then
|
|
|
|
cd ..
|
|
|
|
fi
|
2000-12-05 19:53:24 -01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd $UPD
|
|
|
|
done
|
|
|
|
|
|
|
|
echo Creating .disk/info files
|
|
|
|
echo $INFO1 >CD1/.disk/info
|
|
|
|
echo $INFO2 >CD2/.disk/info
|
2001-05-25 00:02:55 +00:00
|
|
|
echo $INFO3 >CD3/.disk/info
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
echo Creating Packages files
|
|
|
|
for ARCH in $ARCH1
|
|
|
|
do
|
|
|
|
echo $ARCH
|
|
|
|
ARCH=$ARCH $scanpackages scan CD1
|
|
|
|
ARCH=$ARCH $scanpackages -noPackages.cd install CD1
|
2001-04-27 22:44:58 +00:00
|
|
|
rm -f CD1/*.Packages*
|
2000-12-05 19:53:24 -01:00
|
|
|
done
|
|
|
|
|
|
|
|
for ARCH in $ARCH2
|
|
|
|
do
|
|
|
|
echo $ARCH
|
|
|
|
ARCH=$ARCH $scanpackages scan CD2
|
|
|
|
ARCH=$ARCH $scanpackages -noPackages.cd install CD2
|
2001-04-27 22:44:58 +00:00
|
|
|
rm -f CD2/*.Packages*
|
2000-12-05 19:53:24 -01:00
|
|
|
done
|
|
|
|
|
|
|
|
echo Creating Sources files
|
2001-05-25 00:02:55 +00:00
|
|
|
$scansources CD3
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
rm CD?/CD?.*
|
|
|
|
|
|
|
|
${MKISOFS} -J -r -V "Debian $VER update CD" -o $OUT/potato-update-1.raw CD1
|
2001-02-07 10:08:22 -01:00
|
|
|
${MKISOFS} -J -r -V "Debian $VER update CD" -o $OUT/potato-update-2.raw CD2
|
2001-05-25 00:02:55 +00:00
|
|
|
${MKISOFS} -J -r -V "Debian $VER update CD" -o $OUT/potato-update-3.raw CD3
|