Merge ~mwhudson/debian-cd/+git/ubuntu:deb822-sources into ~ubuntu-cdimage/debian-cd/+git/ubuntu:main

Proposed by Michael Hudson-Doyle
Status: Needs review
Proposed branch: ~mwhudson/debian-cd/+git/ubuntu:deb822-sources
Merge into: ~ubuntu-cdimage/debian-cd/+git/ubuntu:main
Diff against target: 563 lines (+104/-286)
7 files modified
CONF.sh (+1/-6)
Makefile (+4/-30)
build_all.sh (+1/-5)
tools/apt-selection (+7/-122)
tools/guess-mirror (+36/-0)
tools/list2cds (+0/-1)
tools/scanpackages (+55/-122)
Reviewer Review Type Date Requested Status
Łukasz Zemczak Needs Information
Review via email: mp+460372@code.launchpad.net

This proposal supersedes a proposal from 2023-12-06.

Description of the change

This is the partner to https://code.launchpad.net/~mwhudson/ubuntu-cdimage/+git/ubuntu-cdimage-1/+merge/457014, it uses the chdist-list apt setup from that branch to fetch packages from the pool rather than one locally created by debian-cd.

Resubmitting now that my prerequisite branches have all been merged.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Just a quick question before I try to figure this out on my own by diving into unknown-to-me debian-cd territory: after this change, will it still be possible to build non-deb822-driven series? Since we need to be able to still build jammy and such. Does the apt config used here get propagated to the images?

review: Needs Information
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Nothing about this should affect the images, it's just the apt config that is used to fetch packages to put into the pool.

c01d20d... by Michael Hudson-Doyle

rationalize scanpackages a bunch

cabffe8... by Michael Hudson-Doyle

fix

78aac4e... by Michael Hudson-Doyle

remove slightly more dead code

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I've rebased to remove a commit that wasn't meant to be part of this change. I'd like to land this early in the devel cycle...

4ac4808... by Michael Hudson-Doyle

do not litter ISO with apt-ftparchive files

Unmerged commits

4ac4808... by Michael Hudson-Doyle

do not litter ISO with apt-ftparchive files

78aac4e... by Michael Hudson-Doyle

remove slightly more dead code

cabffe8... by Michael Hudson-Doyle

fix

c01d20d... by Michael Hudson-Doyle

rationalize scanpackages a bunch

7187f26... by Michael Hudson-Doyle

remove remaining uses of $MIRROR

5a163b4... by Michael Hudson-Doyle

remove references to ADIR and APTTMP

84bbdd3... by Michael Hudson-Doyle

use ubuntu-cdimage provided apt configuration for all apt work

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/CONF.sh b/CONF.sh
2index da12b60..1672c22 100644
3--- a/CONF.sh
4+++ b/CONF.sh
5@@ -136,13 +136,12 @@ export ARCH=`dpkg --print-architecture`
6
7 export FULLARCH=$ARCH${SUBARCH:++$SUBARCH}
8
9-# IMPORTANT : The 4 following paths must be on the same partition/device.
10+# IMPORTANT : The 2 following paths must be on the same partition/device.
11 # If they aren't then you must set COPYLINK below to 1. This
12 # takes a lot of extra room to create the sandbox for the ISO
13 # images, however. Also, if you are using an NFS partition for
14 # some part of this, you must use this option.
15 # Paths to the mirrors
16-export MIRROR=${MIRROR:-$CDIMAGE_ROOT/ftp}
17
18 # cdimage supports running in subtrees, so handle that path as well
19 export SUBTREE=${CDIMAGE_SUBTREE:+$CDIMAGE_SUBTREE/}
20@@ -153,10 +152,6 @@ export TDIR=$CDIMAGE_ROOT/scratch/$SUBTREE$PROJECT/$DIST/$IMAGE_TYPE/tmp
21 # Path where the images will be written
22 export OUT=$CDIMAGE_ROOT/scratch/$SUBTREE$PROJECT/$DIST/$IMAGE_TYPE/debian-cd
23
24-# Where we keep the temporary apt stuff.
25-# This cannot reside on an NFS mount.
26-export APTTMP=$CDIMAGE_ROOT/scratch/$SUBTREE$PROJECT/$DIST/$IMAGE_TYPE/apt
27-
28 # Where extracted debootstrap scripts live
29 export DEBOOTSTRAP=$CDIMAGE_ROOT/scratch/$SUBTREE$PROJECT/$DIST/$IMAGE_TYPE/debootstrap
30
31diff --git a/Makefile b/Makefile
32index 3aad28e..b1761a9 100644
33--- a/Makefile
34+++ b/Makefile
35@@ -112,8 +112,7 @@ verbose=$(BASEDIR)/tools/verbose_command
36 make_raw_img=$(BASEDIR)/tools/make-raw-img
37 hardlink=$(BASEDIR)/tools/hardlink
38
39-BDIR=$(TDIR)/$(CODENAME)-$(FULLARCH)
40-ADIR=$(APTTMP)/$(CODENAME)-$(FULLARCH)
41+export BDIR=$(TDIR)/$(CODENAME)-$(FULLARCH)
42
43 FIRSTDISKS=CD1
44
45@@ -211,9 +210,6 @@ endif
46 ifndef BASEDIR
47 @echo BASEDIR undefined -- set up CONF.sh; false
48 endif
49-ifndef MIRROR
50- @echo MIRROR undefined -- set up CONF.sh; false
51-endif
52 ifndef ARCH
53 @echo ARCH undefined -- set up CONF.sh; false
54 endif
55@@ -232,17 +228,13 @@ endif
56 ## INITIALIZATION ##
57
58 # Creation of the directories needed
59-init: ok $(OUT) $(TDIR) $(BDIR) $(ADIR)
60+init: ok $(OUT) $(TDIR) $(BDIR)
61 $(OUT):
62 $(Q)mkdir -p $(OUT)
63 $(TDIR):
64 $(Q)mkdir -p $(TDIR)
65 $(BDIR):
66 $(Q)mkdir -p $(BDIR)
67-$(ADIR):
68- $(Q)mkdir -p $(ADIR)
69- $(Q)mkdir -p $(ADIR)/apt-ftparchive-db
70- $(Q)mkdir -p $(ADIR)/apt/preferences.d
71
72 ## CLEANINGS ##
73
74@@ -260,25 +252,10 @@ distclean: ok bin-distclean
75 bin-distclean:
76 $(Q)echo "Cleaning the binary build directory"
77 $(Q)rm -rf $(BDIR)
78- $(Q)rm -rf $(ADIR)
79
80 ## APT ##
81
82-# Configure apt stuff
83-apt-setup: init $(ADIR)/apt-setup
84-$(ADIR)/apt-setup:
85- @echo "Setting up archive keyring from host keyring"
86- $(Q)mkdir -p $(ADIR)/apt/trusted.gpg.d
87- $(Q)for file in /etc/apt/trusted.gpg.d/*; do \
88- if [ -e $$file ]; then \
89- ln -s $$file $(ADIR)/apt/trusted.gpg.d/$$(basename $$file); \
90- fi; \
91- done
92- # Create the apt state directory and update the database
93- $(Q)$(apt) update
94- touch $(ADIR)/apt-setup
95-
96-apt-update: apt-setup
97+apt-update:
98 @echo "Apt-get is updating its files ..."
99 $(Q)$(apt) update
100
101@@ -385,10 +362,7 @@ ifeq ($(GENERATE_POOL),1)
102 dir=$(BDIR)/CD1; \
103 echo "1 ... "; \
104 grep -v '^#' $(BDIR)/1.packages | xargs -n 200 -r $(add_packages) $$dir; \
105- $(scanpackages) scan $$dir; \
106- echo "done.";
107- @#Now install the Packages and Packages.cd files
108- $(scanpackages) install $(BDIR)/CD1;
109+ $(scanpackages) $$dir;
110 else
111 @echo "Not generating the package pool"
112 endif
113diff --git a/build_all.sh b/build_all.sh
114index 93eddd4..51f9b26 100755
115--- a/build_all.sh
116+++ b/build_all.sh
117@@ -24,13 +24,9 @@ do
118 CDREV=`git rev-parse HEAD`
119 echo "Using revision $CDREV of debian-cd"
120
121- if type find-mirror >/dev/null 2>&1; then
122- # TODO: nasty upcall to cdimage wrapper scripts
123- export MIRROR="$(find-mirror "$ARCH")"
124- fi
125 echo " ... cleaning"
126 make distclean
127- make apt-setup
128+ make init
129
130 echo " ... selecting packages to include"
131 SIZE_ARGS=''
132diff --git a/tools/apt-selection b/tools/apt-selection
133index e373858..723db82 100755
134--- a/tools/apt-selection
135+++ b/tools/apt-selection
136@@ -1,134 +1,19 @@
137 #!/bin/sh
138
139-# This is a little shell script that will launch apt-get in dry-run mode
140-# to find all the dependencies of a specific package
141+set -e
142
143-# There's not set -e here because this script may fail !
144-# Apt doesn't always work ...
145-# set -e
146-
147-# Get the configuration information if necessary
148-if [ -z "$CODENAME" -o -z "$ARCH" -o -z "$APTTMP" ]; then
149- if [ -e CONF.sh ]; then
150- source CONF.sh
151- else
152- echo "Please set the good environment variables before "
153- echo "launching this program ..."
154- echo "Current values are :"
155- echo "CODENAME=$CODENAME"
156- echo "ARCH=$ARCH"
157- echo "APTTMP=$APTTMP"
158- fi
159-fi
160-if [ -z "$FULLARCH" ]; then
161- FULLARCH="$ARCH"
162-fi
163-
164-options=" -q -o Dir=$APTTMP/$CODENAME-$FULLARCH/ \
165- -o Dir::State::status=/dev/null \
166- -o Dir::State=$APTTMP/$CODENAME-$FULLARCH/apt-state/ \
167- -o Dir::Cache=$APTTMP/$CODENAME-$FULLARCH/apt-cache/ \
168- -o Dir::Etc=$APTTMP/$CODENAME-$FULLARCH/apt/ \
169- -o APT::Cache::AllVersions=0 \
170- -o APT::Architecture=$ARCH "
171-
172-if [ -f "$BASEDIR/data/$CODENAME/multiarch/$ARCH" ]; then
173- SECONDARY_ARCH="$(cat $BASEDIR/data/$CODENAME/multiarch/$ARCH)"
174- options="$options -o APT::Architectures=$SECONDARY_ARCH "
175-fi
176-
177-sections=main
178-if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ]; then
179- sections="$sections non-free"
180-fi
181-if [ "${CONTRIB:-0}" != "0" ]; then
182- sections="$sections contrib"
183-fi
184-if [ "${RESTRICTED:-0}" != "0" ]; then
185- sections="$sections restricted"
186-fi
187-if [ "${UNIVERSE:-0}" != "0" ]; then
188- sections="$sections universe"
189-fi
190-if [ "${MULTIVERSE:-0}" != "0" ]; then
191- sections="$sections multiverse"
192-fi
193-
194-# Check for the necessary dirs and files ...
195-if [ ! -d "$APTTMP/$CODENAME-$FULLARCH/apt-state/lists/partial" ]; then
196- mkdir -p "$APTTMP/$CODENAME-$FULLARCH/apt-state/lists/partial"
197-fi
198-if [ ! -d "$APTTMP/$CODENAME-$FULLARCH/apt-cache/archives/partial" ]; then
199- mkdir -p "$APTTMP/$CODENAME-$FULLARCH/apt-cache/archives/partial"
200-fi
201-if [ ! -d "$APTTMP/$CODENAME-$FULLARCH/apt" ]; then
202- mkdir -p "$APTTMP/$CODENAME-$FULLARCH/apt"
203-fi
204-
205-case $MIRROR in
206- *:*)
207- SCHEMA=
208- ;;
209- *)
210- SCHEMA=file:
211- ;;
212-esac
213-
214-if [ ! -e "$APTTMP/$CODENAME-$FULLARCH/apt/sources.list" ]; then
215- # Generating a correct sources.list file
216- echo "deb $SCHEMA$MIRROR $CODENAME $sections" \
217- > $APTTMP/$CODENAME-$FULLARCH/apt/sources.list
218- echo "deb-src $SCHEMA$MIRROR $CODENAME $sections" \
219- >> $APTTMP/$CODENAME-$FULLARCH/apt/sources.list
220- # Post-release updates
221- if [ "${UPDATES:-0}" != "0" ]; then
222- echo "deb $SCHEMA$MIRROR $CODENAME-updates $sections" \
223- >> $APTTMP/$CODENAME-$FULLARCH/apt/sources.list
224- echo "deb-src $SCHEMA$MIRROR $CODENAME-updates $sections" \
225- >> $APTTMP/$CODENAME-$FULLARCH/apt/sources.list
226- fi
227- if [ "${PROPOSED:-0}" != "0" ]; then
228- echo "deb $SCHEMA$MIRROR $CODENAME-proposed $sections" \
229- >> $APTTMP/$CODENAME-$FULLARCH/apt/sources.list
230- echo "deb-src $SCHEMA$MIRROR $CODENAME-proposed $sections" \
231- >> $APTTMP/$CODENAME-$FULLARCH/apt/sources.list
232- fi
233-fi
234-
235-temp=$APTTMP/$CODENAME-$FULLARCH/temp.apt-selection
236+export APT_CONFIG=$(eval "echo \$APT_CONFIG_${ARCH}")
237
238 # Launch the command
239 if [ "$1" = "update" -o "$1" = "check" -o "$1" = "download" ]; then
240- apt-get $options $@
241- exit $?
242-elif [ "$1" = "cache" ]; then
243- shift
244- apt-cache $options $@
245- exit $?
246+ apt-get $@
247 elif [ "$1" = "config" ]; then
248 shift
249- apt-config $options $@
250- exit $?
251-elif [ "$1" = "deselected" ]; then
252- shift
253- apt-get $options -s $@ > $temp
254- num=$?
255- #if [ $num -ne 0 ]; then
256- #echo ": Param: apt-selection deselected $@" >&2;
257- #exit $num;
258- #fi
259- perl -ne 'print "$1\n" if /^Remv (\S+).*/' $temp | sort
260-elif [ "$1" = "selected" ]; then
261+ apt-config $@
262+elif [ "$1" = "cache" ]; then
263 shift
264- apt-get $options -s $@ > $temp
265- num=$?
266- #if [ $num -ne 0 ]; then
267- # echo "ERROR: Param: apt-selection selected $@" >&2;
268- # exit $num;
269- #fi
270- perl -ne 'print "$1\n" if /^Inst (\S+).*/' $temp | sort
271+ apt-cache -o APT::Cache::AllVersions=0 $@
272 else
273- apt-get $options -s $@
274- exit $?
275+ apt-get -s $@
276 fi
277
278diff --git a/tools/guess-mirror b/tools/guess-mirror
279new file mode 100755
280index 0000000..0aef719
281--- /dev/null
282+++ b/tools/guess-mirror
283@@ -0,0 +1,36 @@
284+#!/usr/bin/python3
285+
286+# This script tries to work out the "main" mirror for where we are
287+# pulling packages from the pool from -- by looking for the first
288+# .sources file and taking the first URI from that.
289+#
290+# This is used by scanpackages to find the overrides files when
291+# building the pool, so it's a little bit important that this works
292+# for production builds but not very important if it returns something
293+# bogus when doing something peculiar like building an image out of
294+# the rebuild archive.
295+
296+import glob
297+import os
298+import subprocess
299+import sys
300+
301+from debian import deb822
302+
303+
304+def getconfig(v):
305+ env = dict(os.environ, APT_CONFIG=os.environ["APT_CONFIG_" + os.environ["ARCH"]])
306+ cmd = ["sh", "-c", "eval $(apt-config shell X {}); echo $X".format(v)]
307+ cp = subprocess.run(cmd, env=env, encoding='utf-8', capture_output=True)
308+ return cp.stdout.strip()
309+
310+
311+sources_list_d = getconfig("Dir::Etc::sourceparts/d")
312+
313+first_sources_path = glob.glob(os.path.join(sources_list_d, '*.sources'))[0]
314+
315+with open(first_sources_path) as sources:
316+ for para in deb822.Deb822.iter_paragraphs(sources):
317+ if 'URIs' in para:
318+ print(para['URIs'].split()[0])
319+ sys.exit()
320diff --git a/tools/list2cds b/tools/list2cds
321index 1100519..e7884ee 100755
322--- a/tools/list2cds
323+++ b/tools/list2cds
324@@ -25,7 +25,6 @@ my $maxcds = 1;
325 my $overflowbincds = $ENV{'OVERFLOWBINCDS'} || 1;
326
327 my $apt = "$ENV{'BASEDIR'}/tools/apt-selection";
328-my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'FULLARCH'}";
329 my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-$ENV{'FULLARCH'}";
330 my $verbose = $ENV{'VERBOSE'} || 0;
331
332diff --git a/tools/scanpackages b/tools/scanpackages
333index 84c25d3..62d0e48 100755
334--- a/tools/scanpackages
335+++ b/tools/scanpackages
336@@ -4,22 +4,9 @@
337 # See the README file for the license
338
339 # This script will create the Packages.gz and the Packages.cd files
340-# First arg = "scan" or "install"
341-# Second arg = directory of the CD
342-
343-#set -e
344-
345-BDIR=$TDIR/$CODENAME-$FULLARCH
346-
347-PREFIX=`echo $2 | sed "s?$BDIR/CD?$BDIR/?"`
348+# Only arg = directory of the CD
349
350 SECTIONS="main"
351-if [ "${NONFREE:-0}" != "0" -o "${EXTRANONFREE:-0}" != "0" ]; then
352- SECTIONS="${SECTIONS} non-free"
353-fi
354-if [ "${CONTRIB:-0}" != "0" ]; then
355- SECTIONS="${SECTIONS} contrib"
356-fi
357 if [ "${RESTRICTED:-0}" != "0" ]; then
358 SECTIONS="${SECTIONS} restricted"
359 fi
360@@ -30,89 +17,23 @@ if [ "${MULTIVERSE:-0}" != "0" ]; then
361 SECTIONS="${SECTIONS} multiverse"
362 fi
363
364-COMPONENTS="$SECTIONS"
365-
366 ALL_ARCHES="$ARCH"
367 if [ -e "$BASEDIR/data/$CODENAME/multiarch/$ARCH" ]; then
368 ALL_ARCHES="$ALL_ARCHES $(cat "$BASEDIR/data/$CODENAME/multiarch/$ARCH")"
369 fi
370
371-
372-cd "$2"
373-
374-if [ "$1" = "install" ]; then
375-
376-# these two lines can be inserted below the "Architectures" line below,
377-# to sort out broken Release files just after the testing --> stable
378-# transition
379-# sed -e "s/^Suite: .*$/Suite: stable/" | \
380-# sed -e "s/^Description: .*$/Description: Debian $DEBVERSION/" | \
381-
382-$BASEDIR/tools/apt-selection update
383-
384-# Appending /d to the name of the configuration item gets apt-config
385-# to expand the item into a full directory path.
386-eval "$($BASEDIR/tools/apt-selection config shell APT_LISTS_DIR Dir::state::lists/d)"
387-
388-IN_RELEASE=$APT_LISTS_DIR/*_dists_${CODENAME}_InRelease
389-
390-if [ -e $IN_RELEASE ]; then
391- # Strip the MD5Sum, SHA1, and SHA256 fields
392- # Update some other information as well
393- gpg --verify --output - $IN_RELEASE 2>/dev/null | \
394- sed -e "s/^Architectures: .*$/Architectures: $ALL_ARCHES/" | \
395- sed -e "s|^Components: .*$|Components: $COMPONENTS|" | \
396- perl -ne 'if (/^(MD5Sum|SHA1|SHA256):/i) { $f=1; next }
397- if ($f) {
398- unless (/^ /) { print; $f=0 }
399- } else { print }' > dists/$CODENAME/Release
400-else
401- echo "ERROR: Release file ($IN_RELEASE) is missing !"
402- exit 1
403-fi
404-
405-# Generating Packages files
406-apt-ftparchive --no-contents --no-md5 --no-sha1 generate $PREFIX.generate-binary
407-
408-fi ## END "$1" = "install"
409-
410-# Prepare the files needed to generate the Packages files
411-if [ "$1" != "scan" ]; then exit 0; fi
412+cd "$1"
413
414 #
415 # Create the file lists and the config files for apt-ftparchive generate
416 #
417
418-# We have to scan all possible dists where packages can be
419-DISTS=""
420-for i in `cd dists; echo *; cd ..`; do
421- if [ ! -L "dists/$i" -a -d "dists/$i" ]; then
422- if [ -d "dists/$i/main/binary-$ARCH" -o \
423- -d "dists/$i/non-free/binary-$ARCH" -o \
424- -d "dists/$i/contrib/binary-$ARCH" -o \
425- -d "dists/$i/restricted/binary-$ARCH" -o \
426- -d "dists/$i/universe/binary-$ARCH" -o \
427- -d "dists/$i/multiverse/binary-$ARCH" ]; then
428- DISTS="$DISTS $i"
429- fi
430- fi
431-done
432 # Creating the file lists
433 for SECT in $SECTIONS; do
434- touch $PREFIX.filelist_$SECT
435+ touch ../1.filelist_$SECT
436 if [ -d "pool/$SECT" ]; then
437- find pool/$SECT | sort >>$PREFIX.filelist_$SECT
438- fi
439- if [ -d "pool/unstable/$SECT" ]; then
440- find pool/unstable/$SECT | sort >>$PREFIX.filelist_$SECT
441+ find pool/$SECT | sort >>../1.filelist_$SECT
442 fi
443- for DIST in $DISTS; do
444- for ONE_ARCH in $ALL_ARCHES; do
445- if [ -d "dists/$DIST/$SECT/binary-$ONE_ARCH" ]; then
446- find dists/$DIST/$SECT/binary-$ONE_ARCH | sort >>$PREFIX.filelist_$SECT
447- fi
448- done
449- done
450 done
451
452 # Appending /d to the name of the configuration item gets apt-config
453@@ -121,18 +42,18 @@ eval "$($BASEDIR/tools/apt-selection config shell APT_DIR Dir/d)"
454 mkdir -p $APT_DIR/apt-ftparchive-db
455
456 # Creating the config files
457-cat >$PREFIX.generate-binary <<EOF
458-Dir::ArchiveDir "$2";
459+cat >../1.generate-binary <<EOF
460+Dir::ArchiveDir "$1";
461 Dir::OverrideDir "$BDIR/indices";
462 Dir::CacheDir "$APT_DIR/apt-ftparchive-db";
463
464 TreeDefault::Contents " ";
465
466 Tree "dists/$CODENAME" {
467- FileList "$PREFIX.filelist_\$(SECTION)";
468+ FileList "../1.filelist_\$(SECTION)";
469 Sections "$SECTIONS";
470 Architectures "$ALL_ARCHES";
471-
472+
473 BinOverride "override.$CODENAME.\$(SECTION)";
474 ExtraOverride "override.$CODENAME.extra.\$(SECTION)";
475 SrcOverride "override.$CODENAME.\$(SECTION).src";
476@@ -140,40 +61,52 @@ Tree "dists/$CODENAME" {
477 EOF
478
479 # Creating the indices directory
480-if [ ! -d "$BDIR/indices" ]; then
481- mkdir $BDIR/indices
482- case $MIRROR in
483- *:*)
484- wget -nv -nd -A "*$CODENAME*" -P $BDIR/indices -m -l 1 \
485- $MIRROR/indices
486- ;;
487- *)
488- cp $MIRROR/indices/* $BDIR/indices/
489- ;;
490- esac
491- #gunzip -f $BDIR/indices/*.gz
492- for SECT in $SECTIONS; do
493- touch $BDIR/indices/override.$CODENAME.$SECT
494- touch $BDIR/indices/override.$CODENAME.extra.$SECT
495- touch $BDIR/indices/override.$CODENAME.$SECT.src
496- # We will only use the override files for the release pocket, so
497- # merge in overrides from any update pockets we're using.
498- if [ "${UPDATES:-0}" != "0" ]; then
499- cat $BDIR/indices/override.$CODENAME-updates.$SECT >> $BDIR/indices/override.$CODENAME.$SECT
500- cat $BDIR/indices/override.$CODENAME-updates.extra.$SECT >> $BDIR/indices/override.$CODENAME.extra.$SECT
501- cat $BDIR/indices/override.$CODENAME-updates.$SECT.src >> $BDIR/indices/override.$CODENAME.$SECT.src
502- fi
503- if [ "${PROPOSED:-0}" != "0" ]; then
504- cat $BDIR/indices/override.$CODENAME-proposed.$SECT >> $BDIR/indices/override.$CODENAME.$SECT
505- cat $BDIR/indices/override.$CODENAME-proposed.extra.$SECT >> $BDIR/indices/override.$CODENAME.extra.$SECT
506- cat $BDIR/indices/override.$CODENAME-proposed.$SECT.src >> $BDIR/indices/override.$CODENAME.$SECT.src
507- fi
508- # TODO: evil hack that relies on cdimage/bin/germinate-to-tasks
509- grep -vw Task "$BDIR/indices/override.$CODENAME.extra.$SECT" > "$BDIR/indices/override.$CODENAME.extra.$SECT.new"
510- mv "$BDIR/indices/override.$CODENAME.extra.$SECT.new" "$BDIR/indices/override.$CODENAME.extra.$SECT"
511- cat "$BASEDIR/tasks/auto/$IMAGE_TYPE/$PROJECT/$CODENAME/override.$FULLARCH" >> "$BDIR/indices/override.$CODENAME.extra.$SECT"
512- "$BASEDIR/tools/sync-priorities" "$BDIR/indices/override.$CODENAME.$SECT" "$BASEDIR/tasks/auto/$IMAGE_TYPE/$PROJECT/$CODENAME/important.$FULLARCH"
513- done
514+mkdir $BDIR/indices
515+wget -nv -nd -A "*$CODENAME*" -P $BDIR/indices -m -l 1 \
516+ $MIRROR/indices
517+for SECT in $SECTIONS; do
518+ touch $BDIR/indices/override.$CODENAME.$SECT
519+ touch $BDIR/indices/override.$CODENAME.extra.$SECT
520+ touch $BDIR/indices/override.$CODENAME.$SECT.src
521+ # We will only use the override files for the release pocket, so
522+ # merge in overrides from any update pockets we're using.
523+ if [ "${UPDATES:-0}" != "0" ]; then
524+ cat $BDIR/indices/override.$CODENAME-updates.$SECT >> $BDIR/indices/override.$CODENAME.$SECT
525+ cat $BDIR/indices/override.$CODENAME-updates.extra.$SECT >> $BDIR/indices/override.$CODENAME.extra.$SECT
526+ cat $BDIR/indices/override.$CODENAME-updates.$SECT.src >> $BDIR/indices/override.$CODENAME.$SECT.src
527+ fi
528+ if [ "${PROPOSED:-0}" != "0" ]; then
529+ cat $BDIR/indices/override.$CODENAME-proposed.$SECT >> $BDIR/indices/override.$CODENAME.$SECT
530+ cat $BDIR/indices/override.$CODENAME-proposed.extra.$SECT >> $BDIR/indices/override.$CODENAME.extra.$SECT
531+ cat $BDIR/indices/override.$CODENAME-proposed.$SECT.src >> $BDIR/indices/override.$CODENAME.$SECT.src
532+ fi
533+ # TODO: evil hack that relies on cdimage/bin/germinate-to-tasks
534+ grep -vw Task "$BDIR/indices/override.$CODENAME.extra.$SECT" > "$BDIR/indices/override.$CODENAME.extra.$SECT.new"
535+ mv "$BDIR/indices/override.$CODENAME.extra.$SECT.new" "$BDIR/indices/override.$CODENAME.extra.$SECT"
536+ cat "$BASEDIR/tasks/auto/$IMAGE_TYPE/$PROJECT/$CODENAME/override.$FULLARCH" >> "$BDIR/indices/override.$CODENAME.extra.$SECT"
537+ "$BASEDIR/tools/sync-priorities" "$BDIR/indices/override.$CODENAME.$SECT" "$BASEDIR/tasks/auto/$IMAGE_TYPE/$PROJECT/$CODENAME/important.$FULLARCH"
538+done
539+
540+# Appending /d to the name of the configuration item gets apt-config
541+# to expand the item into a full directory path.
542+eval "$($BASEDIR/tools/apt-selection config shell APT_LISTS_DIR Dir::state::lists/d)"
543+
544+IN_RELEASE=$APT_LISTS_DIR/*_dists_${CODENAME}_InRelease
545+
546+if [ -e $IN_RELEASE ]; then
547+ # Strip the MD5Sum, SHA1, and SHA256 fields
548+ # Update some other information as well
549+ gpg --verify --output - $IN_RELEASE 2>/dev/null | \
550+ sed -e "s/^Architectures: .*$/Architectures: $ALL_ARCHES/" | \
551+ sed -e "s|^Components: .*$|Components: $SECTIONS|" | \
552+ perl -ne 'if (/^(MD5Sum|SHA1|SHA256):/i) { $f=1; next }
553+ if ($f) {
554+ unless (/^ /) { print; $f=0 }
555+ } else { print }' > dists/$CODENAME/Release
556+else
557+ echo "ERROR: Release file ($IN_RELEASE) is missing !"
558+ exit 1
559 fi
560
561-exit 0
562+# Generating Packages files
563+apt-ftparchive --no-contents --no-md5 --no-sha1 generate ../1.generate-binary

Subscribers

People subscribed via source and target branches