2001-04-14 20:57:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# We are in the temp directory of a CD image
|
|
|
|
# aka $[SB]DIR/CD<x>/
|
|
|
|
# Everything is already in place (just md5sum.txt missing)
|
|
|
|
|
|
|
|
|
|
|
|
# Complete the "Release" file if it exists
|
|
|
|
|
|
|
|
if [ -e "dists/$CODENAME/Release" ]; then
|
2001-04-25 22:27:55 +00:00
|
|
|
# Add the MD5Sum field again
|
|
|
|
echo "MD5Sum:" >> dists/$CODENAME/Release
|
2001-04-14 20:57:06 +00:00
|
|
|
find dists/$CODENAME/ -name 'Packages' -o -name 'Packages.gz' \
|
2001-04-14 22:38:51 +00:00
|
|
|
-o -name 'Sources' -o -name 'Sources.gz' -o -name 'Release' | \
|
|
|
|
grep -v non-US/ | grep -v dists/$CODENAME/Release | \
|
2001-04-14 20:57:06 +00:00
|
|
|
sed -e "s#^dists/$CODENAME/##" | \
|
|
|
|
(while read file; do \
|
2001-04-14 22:38:51 +00:00
|
|
|
rfile="dists/$CODENAME/$file"; \
|
|
|
|
c=`wc -c < $rfile`; \
|
|
|
|
m=`md5sum < $rfile`; \
|
2001-04-14 20:57:06 +00:00
|
|
|
printf " %s %8d %s\n" $m $c $file; \
|
|
|
|
done) >> dists/$CODENAME/Release
|
2001-04-25 22:27:55 +00:00
|
|
|
# TODO: Should add SHA1 field here
|
|
|
|
# Check with libdigest-sha1-perl
|
2001-04-14 20:57:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$NONUS" -a -e "dists/$CODENAME/non-US/Release" ]; then
|
2001-04-25 22:27:55 +00:00
|
|
|
# Add the MD5Sum field again
|
|
|
|
echo "MD5Sum:" >> dists/$CODENAME/non-US/Release
|
2001-04-14 20:57:06 +00:00
|
|
|
find dists/$CODENAME/non-US/ -name 'Packages' -o -name 'Packages.gz' \
|
2001-04-14 22:38:51 +00:00
|
|
|
-o -name 'Sources' -o -name 'Sources.gz' -o -name 'Release' | \
|
|
|
|
grep -v dists/$CODENAME/non-US/Release | \
|
2001-04-14 20:57:06 +00:00
|
|
|
sed -e "s#^dists/$CODENAME/non-US/##" | \
|
|
|
|
(while read file; do \
|
2001-04-14 22:38:51 +00:00
|
|
|
rfile="dists/$CODENAME/non-US/$file"; \
|
|
|
|
c=`wc -c < $rfile`; \
|
|
|
|
m=`md5sum < $rfile`; \
|
2001-04-14 20:57:06 +00:00
|
|
|
printf " %s %8d %s\n" $m $c $file; \
|
|
|
|
done) >> dists/$CODENAME/non-US/Release
|
2001-04-25 22:27:55 +00:00
|
|
|
# TODO: Should add SHA1 field here
|
|
|
|
# Check with libdigest-sha1-perl
|
2001-04-14 20:57:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Create the $CODENAME-secured tree by copying files from the mirror
|
|
|
|
# And including the Release file and its signature
|
|
|
|
|
2001-07-21 15:50:09 +00:00
|
|
|
if [ -n "$SECURED" ]; then
|
|
|
|
|
2001-04-14 20:57:06 +00:00
|
|
|
test -d "dists/$CODENAME-secured" || mkdir dists/$CODENAME-secured
|
|
|
|
if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then
|
|
|
|
# Copy Release and Release.gpg files
|
|
|
|
cp $MIRROR/dists/$CODENAME/Release dists/$CODENAME-secured/
|
|
|
|
if [ -e "$MIRROR/dists/$CODENAME/Release.gpg" ]; then
|
|
|
|
cp $MIRROR/dists/$CODENAME/Release.gpg dists/$CODENAME-secured/
|
|
|
|
fi
|
2001-04-23 22:15:47 +00:00
|
|
|
# Create the .aptignr file in the standard tree
|
|
|
|
:> dists/$CODENAME/.aptignr
|
2001-04-14 20:57:06 +00:00
|
|
|
# Include files listed in Release that corresponds to our arch
|
|
|
|
grep "^ " dists/$CODENAME-secured/Release | \
|
|
|
|
egrep "binary-$ARCH/|source/" | \
|
|
|
|
(while read m s file; do \
|
|
|
|
dir="dists/$CODENAME-secured/`dirname $file`"; \
|
|
|
|
test -d "$dir" || mkdir -p $dir; \
|
|
|
|
cp $MIRROR/dists/$CODENAME/$file $dir/; \
|
|
|
|
done)
|
2001-04-23 22:15:47 +00:00
|
|
|
# Create the files.list.gz
|
|
|
|
(find pool/ -type f; find dists/ -type f) | \
|
|
|
|
gzip --best -c > dists/$CODENAME-secured/files.list.gz
|
2001-04-14 20:57:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then
|
|
|
|
if [ ! -d "dists/$CODENAME-secured/non-US" ]; then
|
|
|
|
mkdir dists/$CODENAME-secured/non-US
|
|
|
|
fi
|
|
|
|
# Copy Release and Release.gpg files
|
|
|
|
cp $NONUS/dists/$CODENAME/non-US/Release dists/$CODENAME-secured/non-US/
|
|
|
|
if [ -e "$NONUS/dists/$CODENAME/non-US/Release.gpg" ]; then
|
|
|
|
cp $NONUS/dists/$CODENAME/non-US/Release.gpg \
|
|
|
|
dists/$CODENAME-secured/non-US/
|
|
|
|
fi
|
|
|
|
# Include files listed in Release that corresponds to our arch
|
|
|
|
grep "^ " dists/$CODENAME-secured/non-US/Release | \
|
|
|
|
egrep "binary-$ARCH/|source/" | \
|
|
|
|
(while read m s file; do \
|
|
|
|
dir="dists/$CODENAME-secured/non-US/`dirname $file`"; \
|
|
|
|
test -d "$dir" || mkdir -p $dir; \
|
|
|
|
cp $NONUS/dists/$CODENAME/non-US/$file $dir/; \
|
|
|
|
done)
|
2001-04-23 22:15:47 +00:00
|
|
|
# The non-US files.list.gz is the same than the main one
|
|
|
|
ln -sf ../files.list.gz dists/$CODENAME-secured/non-US/files.list.gz
|
2001-04-14 20:57:06 +00:00
|
|
|
fi
|
|
|
|
|
2001-07-21 15:50:09 +00:00
|
|
|
|
|
|
|
fi # if secured
|