2008-01-19 18:52:56 -01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Quick hack - add extra sources for this arch onto the last *binary* CD
|
|
|
|
# Initially written for the unofficial amd64 CDs in sarge...
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
BDIR=$1
|
|
|
|
ARCH=$2
|
|
|
|
BASEDIR=$3
|
|
|
|
CODENAME=$4
|
|
|
|
MIRROR=$5
|
|
|
|
|
|
|
|
SOURCE_LIST=$BASEDIR/data/$CODENAME/$ARCH/extra-sources
|
|
|
|
DISKNUM=`ls -l $BDIR/?.packages $BDIR/??.packages | wc -l | tr -d " "`
|
|
|
|
SOURCES=`ls -1 $MIRROR/dists/$CODENAME/*/source/Sources.gz`
|
|
|
|
|
|
|
|
echo "dedicated_source: Need to add the following sources to $ARCH CD#$DISKNUM:"
|
|
|
|
|
|
|
|
mkdir $BDIR/CD$DISKNUM/extra-sources
|
|
|
|
for SRC in `grep -v ^# $SOURCE_LIST`
|
|
|
|
do
|
|
|
|
echo "$SRC:"
|
|
|
|
FILES=`zcat $SOURCES | awk -v SOURCE=$SRC '
|
|
|
|
/^Package:/ { if ($2 == SOURCE) { found=1 } }
|
|
|
|
/^Directory:/ { DIR=$2 }
|
|
|
|
/^ / { if (found) { printf(" %s/%s\n",DIR,$3) }}
|
|
|
|
/^$/ {found=0}
|
|
|
|
'`
|
|
|
|
for FILE in $FILES
|
|
|
|
do
|
|
|
|
echo " $FILE"
|
2008-12-25 22:51:30 -01:00
|
|
|
cp -aL $MIRROR/$FILE $BDIR/CD$DISKNUM/extra-sources
|
2008-01-19 18:52:56 -01:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|