* Create a $CODENAME-secured tree with Release and Release.gpg file.

* Some esthetic cleanup.
This commit is contained in:
Raphaël Hertzog 2001-04-14 20:57:06 +00:00
parent c213ff5a43
commit 5c171358bc
5 changed files with 138 additions and 20 deletions

View File

@ -68,14 +68,15 @@ list2cds=$(BASEDIR)/tools/list2cds
cds2src=$(BASEDIR)/tools/cds2src
master2tasks=$(BASEDIR)/tools/master2tasks
mirrorcheck=$(BASEDIR)/tools/mirror_check
addpackages=$(BASEDIR)/tools/add_packages
adddirs=$(BASEDIR)/tools/add_dirs
add_packages=$(BASEDIR)/tools/add_packages
add_dirs=$(BASEDIR)/tools/add_dirs
add_bin_doc=$(BASEDIR)/tools/add-bin-doc
scanpackages=$(BASEDIR)/tools/scanpackages
scansources=$(BASEDIR)/tools/scansources
addfiles=$(BASEDIR)/tools/add_files
add_files=$(BASEDIR)/tools/add_files
set_mkisofs_opts=$(BASEDIR)/tools/set_mkisofs_opts
strip_nonus_bin=$(BASEDIR)/tools/strip-nonUS-bin
add_secured=$(BASEDIR)/tools/add_secured
BDIR=$(TDIR)/$(CODENAME)-$(ARCH)
ADIR=$(APTTMP)/$(CODENAME)-$(ARCH)
@ -327,7 +328,7 @@ $(BDIR)/CD1/debian:
dir=$${dir##$(BDIR)/}; \
dir=$(BDIR)/CD$$dir; \
mkdir -p $$dir; \
$(adddirs) $$dir; \
$(add_dirs) $$dir; \
done
src-tree: ok src-list $(SDIR)/CD1/debian
@ -339,7 +340,7 @@ $(SDIR)/CD1/debian:
dir=$${dir##$(SDIR)/}; \
dir=$(SDIR)/CD$$dir; \
mkdir -p $$dir; \
$(adddirs) $$dir; \
$(add_dirs) $$dir; \
done
# CD labels / volume ids / disk info
@ -417,7 +418,7 @@ $(BDIR)/packages-stamp:
n=$${dir##$(BDIR)/}; \
dir=$(BDIR)/CD$$n; \
echo "$$n ... "; \
cat $$i | xargs -n 200 -r $(addpackages) $$dir; \
cat $$i | xargs -n 200 -r $(add_packages) $$dir; \
if [ -x "$(HOOK)" ]; then \
cd $(BDIR) && $(HOOK) $$n before-scanpackages; \
fi; \
@ -446,17 +447,17 @@ $(SDIR)/sources-stamp:
echo -n "main ... "; \
grep -vE "(non-US/|/local/)" $$i > $$i.main || true ; \
if [ -s $$i.main ] ; then \
cat $$i.main | xargs $(addfiles) $$dir $(MIRROR); \
cat $$i.main | xargs $(add_files) $$dir $(MIRROR); \
fi ; \
if [ -n "$(LOCAL)" ]; then \
echo -n "local ... "; \
grep "/local/" $$i > $$i.local || true ; \
if [ -s $$i.local ] ; then \
if [ -n "$(LOCALDEBS)" ] ; then \
cat $$i.local | xargs $(addfiles) \
cat $$i.local | xargs $(add_files) \
$$dir $(LOCALDEBS); \
else \
cat $$i.local | xargs $(addfiles) \
cat $$i.local | xargs $(add_files) \
$$dir $(MIRROR); \
fi; \
fi; \
@ -465,7 +466,7 @@ $(SDIR)/sources-stamp:
echo -n "non-US ... "; \
grep "non-US/" $$i > $$i.nonus || true ; \
if [ -s $$i.nonus ] ; then \
cat $$i.nonus | xargs $(addfiles) $$dir $(NONUS); \
cat $$i.nonus | xargs $(add_files) $$dir $(NONUS); \
fi; \
fi; \
$(scansources) $$dir; \
@ -502,7 +503,7 @@ $(BDIR)/CD1/doc:
@echo "Adding the documentation (bin) ..."
$(Q)set -e; \
for DISK in $(FIRSTDISKS) ; do \
$(addfiles) $(BDIR)/$$DISK $(MIRROR) doc; \
$(add_files) $(BDIR)/$$DISK $(MIRROR) doc; \
done
@for DISK in $(FIRSTDISKS) ; do \
mkdir $(BDIR)/$$DISK/doc/FAQ/html ; \
@ -543,7 +544,7 @@ $(BDIR)/CD1/tools:
@echo "Adding install tools and documentation ..."
$(Q)set -e; \
for DISK in $(FIRSTDISKS) ; do \
$(addfiles) $(BDIR)/$$DISK $(MIRROR) tools ; \
$(add_files) $(BDIR)/$$DISK $(MIRROR) tools ; \
mkdir $(BDIR)/$$DISK/install ; \
if [ -x "$(BASEDIR)/tools/$(CODENAME)/installtools.sh" ]; then \
$(BASEDIR)/tools/$(CODENAME)/installtools.sh $(BDIR)/$$DISK ; \
@ -557,7 +558,7 @@ $(BDIR)/CD1/dists/$(CODENAME)/main/disks-$(ARCH):
$(Q)set -e; \
for DISK in $(FIRSTDISKS) ; do \
mkdir -p $(BDIR)/$$DISK/dists/$(CODENAME)/main/disks-$(ARCH) ; \
$(addfiles) \
$(add_files) \
$(BDIR)/$$DISK/dists/$(CODENAME)/main/disks-$(ARCH) \
$(BOOTDISKS) . ; \
cd $(BDIR)/$$DISK/dists/$(CODENAME)/main/disks-$(ARCH); \
@ -593,14 +594,14 @@ bin-extras: ok
false; \
fi
@echo "Adding dirs '$(DIR)' from '$(ROOTSRC)' to '$(BDIR)/CD$(CD)'" ...
$(Q)$(addfiles) $(BDIR)/CD$(CD) $(ROOTSRC) $(DIR)
$(Q)$(add_files) $(BDIR)/CD$(CD) $(ROOTSRC) $(DIR)
src-extras:
$(Q)if [ -z "$(DIR)" -o -z "$(CD)" -o -z "$(ROOTSRC)" ]; then \
echo "Give me more parameters (DIR, CD and ROOTSRC are required)."; \
false; \
fi
@echo "Adding dirs '$(DIR)' from '$(ROOTSRC)' to '$(SDIR)/CD$(CD)'" ...
$(Q)$(addfiles) $(SDIR)/CD$(CD) $(ROOTSRC) $(DIR)
$(Q)$(add_files) $(SDIR)/CD$(CD) $(ROOTSRC) $(DIR)
## IMAGE BUILDING ##
@ -617,7 +618,7 @@ src-imagesinfo: ok
# Generate a md5sum.txt file listings all files on the CD
md5list: bin-md5list src-md5list
bin-md5list: ok packages $(BDIR)/CD1/md5sum.txt
bin-md5list: ok packages bin-secured $(BDIR)/CD1/md5sum.txt
$(BDIR)/CD1/md5sum.txt:
@echo "Generating md5sum of files from all the binary CDs ..."
$(Q)set -e; \
@ -631,7 +632,7 @@ $(BDIR)/CD1/md5sum.txt:
"dists/stable" | grep -v "dists/frozen" | \
grep -v "dists/unstable" | xargs md5sum > md5sum.txt ; \
done
src-md5list: ok sources $(SDIR)/CD1/md5sum.txt
src-md5list: ok sources src-secured $(SDIR)/CD1/md5sum.txt
$(SDIR)/CD1/md5sum.txt:
@echo "Generating md5sum of files from all the source CDs ..."
$(Q)set -e; \
@ -645,6 +646,35 @@ $(SDIR)/CD1/md5sum.txt:
grep -v "dists/unstable" | xargs md5sum > md5sum.txt ; \
done
# Generate $CODENAME-secured tree with Packages and Release(.gpg) files
# from the official tree
# Complete the Release file from the normal tree
secured: bin-secured src-secured
bin-secured: $(BDIR)/CD1/dists/$(CODENAME)-secured
$(BDIR)/CD1/dists/$(CODENAME)-secured:
@echo "Generating $(CODENAME)-secured on all the binary CDs ..."
$(Q)set -e; \
for file in $(BDIR)/*.packages; do \
dir=$${file%%.packages}; \
n=$${dir##$(BDIR)/}; \
dir=$(BDIR)/CD$$n; \
cd $$dir; \
$(add_secured); \
done
src-secured: $(SDIR)/CD1/dists/$(CODENAME)-secured
$(SDIR)/CD1/dists/$(CODENAME)-secured:
@echo "Generating $(CODENAME)-secured on all the source CDs ..."
$(Q)set -e; \
for file in $(SDIR)/*.sources; do \
dir=$${file%%.sources}; \
dir=$${dir##$(SDIR)/}; \
dir=$(SDIR)/CD$$dir; \
cd $$dir; \
$(add_secured); \
done
# Generates all the images
images: bin-images src-images
bin-images: ok bin-md5list $(OUT)

5
debian/changelog vendored
View File

@ -13,8 +13,11 @@ debian-cd (2.2.4) unstable; urgency=low
* Corrected tools/apt-selection. Closes: #79903
* Does correctly manage pools wrt Packages files.
* Now depends on grep-dctrl.
* Now creates a $CODENAME-secured tree with Release and Release.gpg
files from the archive. Closes: #93612
* Some esthetic corrections to the Makefile.
-- Raphael Hertzog <hertzog@debian.org> Sat, 27 Jan 2001 18:19:21 +0100
-- Raphael Hertzog <hertzog@debian.org> Sat, 14 Apr 2001 22:48:19 +0200
debian-cd (2.2.3) unstable; urgency=low

71
tools/add_secured Executable file
View File

@ -0,0 +1,71 @@
#!/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
find dists/$CODENAME/ -name 'Packages' -o -name 'Packages.gz' \
-o -name 'Sources' -o -name 'Sources.gz' | grep -v non-US/ | \
sed -e "s#^dists/$CODENAME/##" | \
(while read file; do \
c=`wc -c < $file`; \
m=`md5sum < $file`; \
printf " %s %8d %s\n" $m $c $file; \
done) >> dists/$CODENAME/Release
fi
if [ -n "$NONUS" -a -e "dists/$CODENAME/non-US/Release" ]; then
find dists/$CODENAME/non-US/ -name 'Packages' -o -name 'Packages.gz' \
-o -name 'Sources' -o -name 'Sources.gz' | \
sed -e "s#^dists/$CODENAME/non-US/##" | \
(while read file; do \
c=`wc -c < $file`; \
m=`md5sum < $file`; \
printf " %s %8d %s\n" $m $c $file; \
done) >> dists/$CODENAME/non-US/Release
fi
# Create the $CODENAME-secured tree by copying files from the mirror
# And including the Release file and its signature
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
# 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)
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)
fi

View File

@ -33,10 +33,14 @@ cd "$2"
if [ "$1" = "install" ]; then
if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then
cp $MIRROR/dists/$CODENAME/Release* dists/$CODENAME/
sed -e "/^ /d" -e "s/^Architectures: .*$/Architectures: $ARCH/" \
$MIRROR/dists/$CODENAME/Release \
> dists/$CODENAME/Release
fi
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then
cp $NONUS/dists/$CODENAME/non-US/Release* dists/$CODENAME/non-US/
sed -e "/^ /d" -e "s/^Architectures: .*$/Architectures: $ARCH/" \
$NONUS/dists/$CODENAME/non-US/Release \
> dists/$CODENAME/non-US/Release
fi
for SECT in $SECTIONS; do

View File

@ -34,6 +34,16 @@ for i in `cd dists; echo *; cd ..`; do
fi
fi
done
if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then
sed -e "/^ /d" $MIRROR/dists/$CODENAME/Release \
> dists/$CODENAME/Release
fi
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then
sed -e "/^ /d" $NONUS/dists/$CODENAME/non-US/Release \
> dists/$CODENAME/non-US/Release
fi
for SECT in $SECTIONS; do
if [ -d "pool/$SECT" ]; then