Commit 111c10c1 authored by intrigeri's avatar intrigeri
Browse files

Extract list of (origin, reference) from the build configuration.

For now, we hard-code arbitrary snapshot serial numbers in the build
configuration. They at least allow us to write and test the code that
reads them from the configuration tree.

refs: #10748
parent 427792a6
......@@ -201,7 +201,7 @@ if [ -e "${BUILD_FILENAME}.${BUILD_FILENAME_EXT}" ]; then
echo "Renaming generated files..."
mv -i "${BUILD_FILENAME}.${BUILD_FILENAME_EXT}" "${BUILD_DEST_FILENAME}"
mv -i binary.packages "${BUILD_PACKAGES}"
tails-custom-apt-sources chroot/debootstrap "${BUILD_DEST_FILENAME}.build-manifest"
generate-build-manifest chroot/debootstrap "${BUILD_DEST_FILENAME}.build-manifest"
else
fatal "lb build failed ($?)."
fi
......@@ -75,11 +75,14 @@ foreach my $type (keys %package_type) {
}
}
### Extract lists of (origin, reference) from the build:
# XXX: Implement this once the infra is set up, and use static data for now:
my %origin_reference = qw(
debian 2015102601
);
### Extract list of (origin, reference) from the build configuration:
my %origin_reference;
while (my $origin_dir = glob('config/APT_snapshots.d/*')) {
my $origin_name = $origin_dir;
$origin_name =~ s{\A config/APT_snapshots[.]d/}{}xms;
$origin_reference{$origin_name} = read_file("$origin_dir/serial");
chomp $origin_reference{$origin_name};
}
for my $name(values %origin_name) {
$data->{origin_references}->{ $name }->{reference} = $origin_reference{ $name } || 'unknown';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment