1999-11-11 16:10:37 -01:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# Copyright 1999 Rapha<68>l Hertzog <hertzog@debian.org>
|
|
|
|
|
# See the README file for the license
|
|
|
|
|
|
|
|
|
|
# This script will create the Sources.gz files
|
|
|
|
|
# First arg = directory of the CD
|
|
|
|
|
|
2000-02-19 16:52:52 -01:00
|
|
|
|
set -e
|
1999-11-11 16:10:37 -01:00
|
|
|
|
|
2001-11-09 06:55:23 -01:00
|
|
|
|
SDIR=$TDIR/$CODENAME-src
|
|
|
|
|
PREFIX=`echo $1 | sed "s?$SDIR/CD?$SDIR/?"`
|
|
|
|
|
|
2002-12-07 09:33:52 -01:00
|
|
|
|
SECTIONS="main"
|
2002-04-13 12:17:57 +00:00
|
|
|
|
if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ]; then
|
2002-12-07 09:33:52 -01:00
|
|
|
|
SECTIONS="${SECTIONS} non-free"
|
|
|
|
|
fi
|
2002-12-20 00:47:21 -01:00
|
|
|
|
if [ "${CONTRIB:-0}" != "0" ]; then
|
2002-12-07 09:33:52 -01:00
|
|
|
|
SECTIONS="${SECTIONS} contrib"
|
1999-11-11 16:10:37 -01:00
|
|
|
|
fi
|
|
|
|
|
|
2001-11-09 06:55:23 -01:00
|
|
|
|
cd $1
|
1999-11-11 16:10:37 -01:00
|
|
|
|
|
2001-02-27 00:01:40 -01:00
|
|
|
|
# We have to scan all possible dists where sources can be
|
|
|
|
|
DISTS=""
|
|
|
|
|
DISTSNONUS=""
|
|
|
|
|
for i in `cd dists; echo *; cd ..`; do
|
|
|
|
|
if [ ! -L "dists/$i" -a -d "dists/$i" ]; then
|
2001-03-25 14:49:14 +00:00
|
|
|
|
if [ -d "dists/$i/main/source" -o \
|
|
|
|
|
-d "dists/$i/non-free/source" -o \
|
|
|
|
|
-d "dists/$i/contrib/source" ]; then
|
2001-02-27 00:01:40 -01:00
|
|
|
|
DISTS="$DISTS $i"
|
|
|
|
|
fi
|
2001-03-25 14:49:14 +00:00
|
|
|
|
if [ -d "dists/$i/non-US/main/source" -o \
|
|
|
|
|
-d "dists/$i/non-US/non-free/source" -o \
|
|
|
|
|
-d "dists/$i/non-US/contrib/source" ]; then
|
2001-02-27 00:01:40 -01:00
|
|
|
|
DISTSNONUS="$DISTSNONUS $i"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
done
|
2001-04-14 20:57:06 +00:00
|
|
|
|
|
|
|
|
|
if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then
|
2001-04-25 22:27:55 +00:00
|
|
|
|
# Strip the MD5Sum and SHA1 field
|
|
|
|
|
perl -ne 'if (/^(MD5Sum|SHA1):/) { $f=1; next; }
|
|
|
|
|
if ($f) {
|
|
|
|
|
unless (/^ /) { print; $f=0 }
|
|
|
|
|
} else { print }' \
|
|
|
|
|
$MIRROR/dists/$CODENAME/Release > dists/$CODENAME/Release
|
2001-04-14 20:57:06 +00:00
|
|
|
|
fi
|
|
|
|
|
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then
|
2001-04-25 22:27:55 +00:00
|
|
|
|
# Strip the MD5Sum and SHA1 field
|
|
|
|
|
perl -ne 'if (/^(MD5Sum|SHA1):/) { $f=1; next; }
|
|
|
|
|
if ($f) {
|
|
|
|
|
unless (/^ /) { print; $f=0 }
|
|
|
|
|
} else { print }' \
|
|
|
|
|
$NONUS/dists/$CODENAME/non-US/Release \
|
2001-04-14 20:57:06 +00:00
|
|
|
|
> dists/$CODENAME/non-US/Release
|
|
|
|
|
fi
|
|
|
|
|
|
1999-11-11 16:10:37 -01:00
|
|
|
|
|
2001-11-09 06:55:23 -01:00
|
|
|
|
# Creating the file lists
|
|
|
|
|
for SECT in $SECTIONS; do
|
|
|
|
|
touch $PREFIX.sourcefilelist_$SECT
|
|
|
|
|
if [ -d "pool/$SECT" ]; then
|
|
|
|
|
find pool/$SECT >>$PREFIX.sourcefilelist_$SECT
|
|
|
|
|
fi
|
|
|
|
|
for DIST in $DISTS; do
|
|
|
|
|
if [ -d "dists/$DIST/$SECT/binary-$ARCH" ]; then
|
|
|
|
|
find dists/$DIST/$SECT/binary-$ARCH >>$PREFIX.sourcefilelist_$SECT
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ -n "$NONUS" ]; then
|
|
|
|
|
touch $PREFIX.sourcefilelist_non-US_$SECT
|
|
|
|
|
if [ -d "pool/non-US/$SECT" ]; then
|
|
|
|
|
find pool/non-US/$SECT >>$PREFIX.sourcefilelist_non-US_$SECT
|
|
|
|
|
fi
|
|
|
|
|
for DIST in $DISTSNONUS; do
|
|
|
|
|
if [ -d "dists/$DIST/non-US/$SECT/binary-$ARCH" ]; then
|
|
|
|
|
find dists/$DIST/non-US/$SECT/binary-$ARCH \
|
|
|
|
|
>>$PREFIX.sourcefilelist_non-US_$SECT
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
1999-11-11 16:10:37 -01:00
|
|
|
|
done
|
|
|
|
|
|
2001-11-09 06:55:23 -01:00
|
|
|
|
# Creating the config files
|
|
|
|
|
cat >$PREFIX.generate-source <<EOF
|
|
|
|
|
Dir::ArchiveDir "$1";
|
|
|
|
|
Dir::OverrideDir "$SDIR/indices";
|
|
|
|
|
Dir::CacheDir "$APTTMP/$CODENAME-$ARCH/apt-ftparchive-db";
|
|
|
|
|
|
|
|
|
|
TreeDefault::Contents " ";
|
|
|
|
|
|
|
|
|
|
Tree "dists/$CODENAME" {
|
|
|
|
|
SourceFileList "$PREFIX.sourcefilelist_\$(SECTION)";
|
|
|
|
|
Sections "$SECTIONS";
|
|
|
|
|
Architectures "source";
|
|
|
|
|
|
|
|
|
|
BinOverride "override.$CODENAME.\$(SECTION)";
|
|
|
|
|
ExtraOverride "override.$CODENAME.extra.\$(SECTION)";
|
|
|
|
|
SrcOverride "override.$CODENAME.\$(SECTION).src";
|
|
|
|
|
}
|
|
|
|
|
EOF
|
|
|
|
|
cat >$PREFIX.generate-source-non-US <<EOF
|
|
|
|
|
Dir::ArchiveDir "$1";
|
|
|
|
|
Dir::OverrideDir "$SDIR/indices-non-US";
|
|
|
|
|
Dir::CacheDir "$APTTMP/$CODENAME-$ARCH/apt-ftparchive-db";
|
|
|
|
|
|
|
|
|
|
TreeDefault::Contents " ";
|
|
|
|
|
|
|
|
|
|
Tree "dists/$CODENAME/non-US" {
|
|
|
|
|
SourceFileList "$PREFIX.sourcefilelist_non-US_\$(SECTION)";
|
|
|
|
|
Sections "`echo $SECTIONS | sed -e 's# local##'`";
|
|
|
|
|
Architectures "source";
|
|
|
|
|
|
|
|
|
|
BinOverride "override.$CODENAME.\$(SECTION)";
|
|
|
|
|
ExtraOverride "override.$CODENAME.extra.\$(SECTION)";
|
|
|
|
|
SrcOverride "override.$CODENAME.\$(SECTION).src";
|
|
|
|
|
}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
# Creating the indices directory
|
|
|
|
|
if [ ! -d "$SDIR/indices" ]; then
|
|
|
|
|
mkdir $SDIR/indices
|
|
|
|
|
cp $MIRROR/indices/* $SDIR/indices/
|
|
|
|
|
if [ -n "$LOCALDEBS" -a -d $LOCALDEBS/indices ]; then
|
|
|
|
|
cp $LOCALDEBS/indices/* $SDIR/indices/
|
|
|
|
|
fi
|
|
|
|
|
gunzip -f $SDIR/indices/*.gz
|
|
|
|
|
for SECT in $SECTIONS; do
|
|
|
|
|
touch $SDIR/indices/override.$CODENAME.$SECT
|
|
|
|
|
touch $SDIR/indices/override.$CODENAME.extra.$SECT
|
|
|
|
|
touch $SDIR/indices/override.$CODENAME.$SECT.src
|
|
|
|
|
done
|
2000-03-07 17:59:31 -01:00
|
|
|
|
fi
|
2001-11-09 06:55:23 -01:00
|
|
|
|
if [ -n "$NONUS" -a ! -d "$SDIR/indices-non-US" ]; then
|
|
|
|
|
mkdir $SDIR/indices-non-US
|
|
|
|
|
cp $NONUS/indices-non-US/* $SDIR/indices-non-US/
|
|
|
|
|
gunzip -f $SDIR/indices-non-US/*.gz
|
|
|
|
|
for SECT in `echo $SECTIONSNONUS | sed -e 's#non-US/##g'`; do
|
|
|
|
|
touch $SDIR/indices-non-US/override.$CODENAME.$SECT
|
|
|
|
|
touch $SDIR/indices-non-US/override.$CODENAME.extra.$SECT
|
|
|
|
|
touch $SDIR/indices-non-US/override.$CODENAME.$SECT.src
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
apt-ftparchive generate $PREFIX.generate-source
|
|
|
|
|
if [ -n "$NONUS" ]; then
|
|
|
|
|
apt-ftparchive generate $PREFIX.generate-source-non-US
|
|
|
|
|
fi
|
|
|
|
|
|
2000-03-07 17:59:31 -01:00
|
|
|
|
|
1999-11-11 16:10:37 -01:00
|
|
|
|
exit 0
|