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
|
|
|
|
|
|
|
|
|
PREFIX=$1
|
2000-06-06 17:19:27 +00:00
|
|
|
|
if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then
|
1999-11-11 16:10:37 -01:00
|
|
|
|
SECTIONS="main contrib non-free"
|
|
|
|
|
else
|
|
|
|
|
SECTIONS="main contrib"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd $PREFIX
|
|
|
|
|
|
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
|
|
|
|
for SECT in $SECTIONS; do
|
|
|
|
|
|
2001-02-27 00:01:40 -01:00
|
|
|
|
if [ -d "pool/$SECT" ]; then
|
2001-10-06 15:55:12 +00:00
|
|
|
|
apt-ftparchive sources pool/$SECT > dists/$CODENAME/$SECT/source/Sources
|
2001-02-27 00:01:40 -01:00
|
|
|
|
fi
|
|
|
|
|
for DIST in $DISTS; do
|
2001-04-09 23:39:59 +00:00
|
|
|
|
if [ -d "dists/$DIST/$SECT/source" ] ; then
|
2001-10-06 15:55:12 +00:00
|
|
|
|
apt-ftparchive sources dists/$DIST/$SECT/source \
|
2001-04-09 23:39:59 +00:00
|
|
|
|
>> dists/$CODENAME/$SECT/source/Sources
|
|
|
|
|
fi
|
2001-02-27 00:01:40 -01:00
|
|
|
|
done
|
2001-04-09 23:39:59 +00:00
|
|
|
|
if [ -f dists/$CODENAME/$SECT/source/Sources ] ; then
|
|
|
|
|
gzip --best dists/$CODENAME/$SECT/source/Sources
|
|
|
|
|
fi
|
|
|
|
|
|
2001-10-06 15:55:12 +00:00
|
|
|
|
if [ -n "$NONUS" ]; then
|
2001-04-09 23:39:59 +00:00
|
|
|
|
if [ -d "pool/non-US/$SECT" ]; then
|
2001-10-06 15:55:12 +00:00
|
|
|
|
apt-ftparchive sources pool/non-US/$SECT \
|
2001-04-09 23:39:59 +00:00
|
|
|
|
> dists/$CODENAME/non-US/$SECT/source/Sources
|
|
|
|
|
fi
|
|
|
|
|
for DIST in $DISTSNONUS; do
|
2001-10-06 15:55:12 +00:00
|
|
|
|
if [ -d "dists/$DIST/non-US/$SECT/source" ] ; then
|
|
|
|
|
apt-ftparchive sources dists/$DIST/non-US/$SECT/source \
|
|
|
|
|
>> dists/$CODENAME/non-US/$SECT/source/Sources
|
|
|
|
|
fi
|
2001-04-09 23:39:59 +00:00
|
|
|
|
done
|
|
|
|
|
if [ -f dists/$CODENAME/non-US/$SECT/source/Sources ] ; then
|
|
|
|
|
gzip --best dists/$CODENAME/non-US/$SECT/source/Sources
|
|
|
|
|
fi
|
1999-11-11 16:10:37 -01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
2000-03-07 17:59:31 -01:00
|
|
|
|
if [ -n "$LOCAL" ]; then
|
2001-10-06 15:55:12 +00:00
|
|
|
|
apt-ftparchive sources dists/$CODENAME/local/source \
|
2000-03-07 17:59:31 -01:00
|
|
|
|
| gzip --best > dists/$CODENAME/local/source/Sources.gz
|
|
|
|
|
fi
|
|
|
|
|
|
1999-11-11 16:10:37 -01:00
|
|
|
|
exit 0
|