#!/bin/sh # Copyright 1999 Raphaël Hertzog # See the README file for the license # This script will create the Sources.gz files # First arg = directory of the CD #set -e SDIR=$TDIR/$CODENAME-src PREFIX=`echo $1 | sed "s?$SDIR/CD?$SDIR/?"` SECTIONS="main" if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ]; then SECTIONS="${SECTIONS} non-free" fi if [ "${CONTRIB:-0}" != "0" ]; then SECTIONS="${SECTIONS} contrib" fi cd $1 # 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 if [ -d "dists/$i/main/source" -o \ -d "dists/$i/non-free/source" -o \ -d "dists/$i/contrib/source" ]; then DISTS="$DISTS $i" fi 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 DISTSNONUS="$DISTSNONUS $i" fi fi done if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then # 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 fi if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then # 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 \ > dists/$CODENAME/non-US/Release fi # 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 done # Creating the config files cat >$PREFIX.generate-source <$PREFIX.generate-source-non-US <