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.
|
2004-09-07 17:42:40 +00:00
|
|
|
NONUS=${NONUS:-/mirror/debian-non-US}
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# Do you want non-free? 1 for yes, 0 for no
|
2004-09-07 17:42:40 +00:00
|
|
|
NONFREE=0
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# What release version is this?
|
2004-09-07 17:42:40 +00:00
|
|
|
VER=3.0r2
|
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
|
|
|
|
2002-12-21 11:13:08 -01:00
|
|
|
# Building woody cd set ...
|
|
|
|
CODENAME=woody
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
# Path where the images will be written
|
2004-09-07 17:42:40 +00:00
|
|
|
OUT=/mirror/woody-update/r2
|
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.
|
2004-09-07 17:42:40 +00:00
|
|
|
DIFF=/mirror/lists/$CODENAME/r0-r2.diff #~/r2.diff
|
2001-02-07 10:08:22 -01:00
|
|
|
|
2000-12-05 19:53:24 -01:00
|
|
|
REL=Debian"$VER"
|
2002-12-21 11:13:08 -01:00
|
|
|
CLOG=dists/$CODENAME/ChangeLog
|
|
|
|
NUCLOG=dists/$CODENAME/non-US/ChangeLog
|
|
|
|
UPD=$TDIR/$CODENAME-update
|
2000-12-05 19:53:24 -01:00
|
|
|
DATE=`date +%Y%m%d`
|
|
|
|
BASEDIR=`pwd`
|
2002-12-21 11:13:08 -01:00
|
|
|
SECTS="main non-free contrib"
|
|
|
|
VERBOSE=2
|
|
|
|
export VERBOSE BASEDIR SECTS
|
2002-04-16 00:25:46 +00:00
|
|
|
|
2002-12-23 09:03:45 -01:00
|
|
|
ARCHLIST="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc src" # all dealt with specially
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
export TDIR NONFREE NONUS VER MIRROR CODENAME OUT BASEDIR
|
|
|
|
|
2001-12-16 22:22:11 -01:00
|
|
|
scanpackages=$BASEDIR/tools/scanpackages.old
|
|
|
|
scansources=$BASEDIR/tools/scansources.old
|
2000-12-05 19:53:24 -01:00
|
|
|
set_mkisofs_opts=$BASEDIR/tools/set_mkisofs_opts
|
2001-02-07 10:08:22 -01:00
|
|
|
addfiles=$BASEDIR/tools/add_files
|
2000-12-05 19:53:24 -01:00
|
|
|
|
2002-12-21 11:13:08 -01:00
|
|
|
adddirs () {
|
|
|
|
ROOTDIR=$1
|
2002-04-16 00:25:46 +00:00
|
|
|
shift
|
2002-12-21 11:13:08 -01:00
|
|
|
FILELIST=$1
|
|
|
|
for FILE in `cat $FILELIST`
|
2002-04-16 00:25:46 +00:00
|
|
|
do
|
2002-12-21 11:13:08 -01:00
|
|
|
DIR=`echo $FILE | sed 's?/[-_\.A-Za-z0-9\+]*$??'`
|
|
|
|
if [ ! -d $ROOTDIR/$DIR ] ; then
|
|
|
|
mkdir -p $ROOTDIR/$DIR
|
2002-04-16 00:25:46 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2002-12-21 11:13:08 -01:00
|
|
|
copy_trees () {
|
2002-04-16 00:25:46 +00:00
|
|
|
CDDIR=$1
|
|
|
|
shift
|
2002-12-21 11:13:08 -01:00
|
|
|
SRCLIST=$1
|
|
|
|
shift
|
|
|
|
BINLIST=$1
|
|
|
|
shift
|
2002-04-16 00:25:46 +00:00
|
|
|
ARCHES=$*
|
2002-12-23 09:03:45 -01:00
|
|
|
echo " Copying \"$ARCHES\" files into $UPD/$CDDIR"
|
2002-04-16 00:25:46 +00:00
|
|
|
for ARCH in $ARCHES
|
|
|
|
do
|
|
|
|
case "$ARCH" in
|
|
|
|
src)
|
2002-12-21 11:13:08 -01:00
|
|
|
NUM=`cat $SRCLIST | wc -l`
|
|
|
|
if [ $NUM -gt 0 ] ; then
|
2002-12-23 09:03:45 -01:00
|
|
|
echo " $ARCH into $UPD/$CDDIR"
|
2002-12-21 11:13:08 -01:00
|
|
|
adddirs $UPD/$CDDIR $SRCLIST
|
|
|
|
cat $SRCLIST | xargs $addfiles $UPD/$CDDIR $MIRROR
|
|
|
|
else
|
2002-12-23 09:03:45 -01:00
|
|
|
echo " No updates needed for $ARCH"
|
2002-12-21 11:13:08 -01:00
|
|
|
fi
|
2002-04-16 00:25:46 +00:00
|
|
|
;;
|
|
|
|
*)
|
2002-12-21 11:13:08 -01:00
|
|
|
NUM=`cat $BINLIST | grep _$ARCH.deb | wc -l`
|
|
|
|
if [ $NUM -gt 0 ] ; then
|
2002-12-23 09:03:45 -01:00
|
|
|
echo " $ARCH into $UPD/$CDDIR"
|
2002-12-21 11:13:08 -01:00
|
|
|
adddirs $UPD/$CDDIR $BINLIST
|
|
|
|
cat $BINLIST | grep _$ARCH.deb | xargs $addfiles $UPD/$CDDIR $MIRROR
|
|
|
|
else
|
2002-12-23 09:03:45 -01:00
|
|
|
echo " No updates needed for $ARCH"
|
2002-12-21 11:13:08 -01:00
|
|
|
fi
|
2002-04-16 00:25:46 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
create_control_files () {
|
|
|
|
CDDIR=$1
|
|
|
|
shift
|
|
|
|
ARCHES=$*
|
|
|
|
echo " Creating control files for \"$ARCHES\" on $CDDIR"
|
|
|
|
for ARCH in $ARCHES
|
|
|
|
do
|
|
|
|
case "$ARCH" in
|
|
|
|
src)
|
|
|
|
echo " src"
|
2002-12-21 11:13:08 -01:00
|
|
|
for SECT in $SECTS
|
|
|
|
do
|
|
|
|
mkdir -p $CDDIR/dists/$CODENAME/$SECT/source
|
|
|
|
mkdir -p $CDDIR/dists/$CODENAME/non-US/$SECT/source
|
|
|
|
done
|
2002-12-21 11:34:10 -01:00
|
|
|
cd $UPD
|
2002-04-16 00:25:46 +00:00
|
|
|
$scansources $CDDIR >/dev/null 2>&1
|
|
|
|
;;
|
|
|
|
all)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo " $ARCH"
|
2002-12-21 11:13:08 -01:00
|
|
|
for SECT in $SECTS
|
|
|
|
do
|
|
|
|
mkdir -p $CDDIR/dists/$CODENAME/$SECT/binary-$ARCH
|
|
|
|
mkdir -p $CDDIR/dists/$CODENAME/non-US/$SECT/binary-$ARCH
|
|
|
|
done
|
2004-09-07 17:42:40 +00:00
|
|
|
ARCH=$ARCH $scanpackages scan $CDDIR > /dev/null 2>&1
|
|
|
|
ARCH=$ARCH $scanpackages -noPackages.cd install $CDDIR > /dev/null 2>&1
|
2002-12-21 11:13:08 -01:00
|
|
|
rm -f $CDDIR/*.Packages* #>/dev/null 2>&1
|
2002-04-16 00:25:46 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2000-12-05 19:53:24 -01:00
|
|
|
echo Cleaning up
|
|
|
|
rm -rf $UPD
|
2002-12-23 09:03:45 -01:00
|
|
|
mkdir $UPD
|
|
|
|
CDNUM=1
|
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
|
2002-12-21 11:13:08 -01:00
|
|
|
egrep -e \\.gz$ -e \\.dsc$ $UPD/list >$UPD/src-list
|
2001-02-07 10:08:22 -01:00
|
|
|
else
|
2004-09-07 17:42:40 +00:00
|
|
|
egrep -e \\.deb$ $CLOG >$UPD/bin-list
|
2002-12-21 11:13:08 -01:00
|
|
|
egrep -e \\.gz$ -e \\.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
|
|
|
|
|
|
|
|
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
|
2004-09-07 17:42:40 +00:00
|
|
|
egrep -e \\.gz$ -e \\.dsc$ $UPD/nu-list >$UPD/src-nu-list
|
2001-02-07 10:08:22 -01:00
|
|
|
else
|
2004-09-07 17:42:40 +00:00
|
|
|
egrep -e \\.deb$ $NUCLOG | sed 's?^stable?dists/woody?g' > $UPD/bin-nu-list
|
|
|
|
egrep -e \\.gz$ -e \\.dsc$ $NUCLOG | sed 's?^stable?dists/woody?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
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
2002-12-23 09:03:45 -01:00
|
|
|
for THISARCH in $ARCHLIST
|
|
|
|
do
|
|
|
|
if [ $THISARCH = "src" ] ; then
|
|
|
|
echo "Creating CD$CDNUM for source"
|
|
|
|
else
|
|
|
|
echo "Creating CD$CDNUM for binary-$THISARCH and binary-all"
|
|
|
|
fi
|
|
|
|
mkdir $UPD/CD$CDNUM $UPD/CD$CDNUM/.disk
|
|
|
|
INFO="Debian GNU/Linux $VER Update CD $DATE: $THISARCH"
|
|
|
|
echo $INFO > $UPD/CD$CDNUM/.disk/info
|
|
|
|
echo " Copying normal files"
|
|
|
|
if [ $THISARCH = "src" ] ; then
|
|
|
|
copy_trees CD$CDNUM $UPD/src-list $UPD/bin-list $THISARCH
|
|
|
|
else
|
|
|
|
copy_trees CD$CDNUM $UPD/src-list $UPD/bin-list $THISARCH all
|
|
|
|
fi
|
|
|
|
if [ "$NONUS"x != ""x ] ; then
|
|
|
|
echo " Copying non-US files"
|
|
|
|
if [ $THISARCH = "src" ] ; then
|
|
|
|
copy_trees CD$CDNUM $UPD/src-nu-list $UPD/bin-nu-list $THISARCH
|
|
|
|
else
|
|
|
|
copy_trees CD$CDNUM $UPD/src-nu-list $UPD/bin-nu-list $THISARCH all
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo " Creating Packages and Sources files"
|
|
|
|
cd $UPD
|
|
|
|
create_control_files CD$CDNUM $THISARCH
|
|
|
|
echo " Creating image for CD$CDNUM"
|
|
|
|
echo -n " "
|
|
|
|
${MKISOFS} -J -r -V "Debian $VER update CD" -o $OUT/$CODENAME-update-$THISARCH.raw $UPD/CD$CDNUM 2>&1 | grep "extents written"
|
|
|
|
CDNUM=$(($CDNUM + 1))
|
|
|
|
done
|
2000-12-05 19:53:24 -01:00
|
|
|
|
|
|
|
|
|
|
|
|