summaryrefslogtreecommitdiffstats
path: root/files/reprepro/snapshots
diff options
context:
space:
mode:
authorCyril Brulebois <cyril@debamax.com>2016-04-06 09:15:53 +0200
committerCyril Brulebois <cyril@debamax.com>2016-04-06 09:20:19 +0200
commita6c3530284b6472d68f638be7c32412913ff8b78 (patch)
tree7485ff0e8250eb8503ff14ea6dc45fcde8be9fd3 /files/reprepro/snapshots
parent63dd815f7bdca112aac17a7653f6ca4bd37f7a03 (diff)
Document why and how the source=version mapping is built.
Signed-off-by: Cyril Brulebois <cyril@debamax.com>
Diffstat (limited to 'files/reprepro/snapshots')
-rwxr-xr-xfiles/reprepro/snapshots/tagged/tails-prepare-tagged-apt-snapshot-import25
1 files changed, 24 insertions, 1 deletions
diff --git a/files/reprepro/snapshots/tagged/tails-prepare-tagged-apt-snapshot-import b/files/reprepro/snapshots/tagged/tails-prepare-tagged-apt-snapshot-import
index fd5fe55..57311a2 100755
--- a/files/reprepro/snapshots/tagged/tails-prepare-tagged-apt-snapshot-import
+++ b/files/reprepro/snapshots/tagged/tails-prepare-tagged-apt-snapshot-import
@@ -83,8 +83,31 @@ sub get_binaries_and_source_mapping {
my $item = $c->parse($buf_fh, $packages_file);
my ($p, $v, $s, $a) = ($c->{Package}, $c->{Version}, $c->{Source}, $c->{Architecture});
push @results, "$p/$v/$a";
- # Build source=version mapping:
+ ### Build "source = version" mapping
+ #
+ # Basically we have 3 cases to handle:
+ #
+ # - Easy: We have Package, Version, and no Source mentioned. This means that
+ # Package and Source names are the same, and that the version number is
+ # shared as well. Defaulting to "p = v" works.
+ #
+ # - Medium: We have Package, Version, and Source, with source being a single
+ # word. This means a binary package built from a source package which has a
+ # different name; but both have the same version, so "s = v" works.
+ #
+ # - Hard: Same case as above, except we have a version specified in the
+ # Source field. Very usual case: binNMUs (binary has a +bN suffix which the
+ # source package doesn't have). Less usual: source building binaries with
+ # very different versions. Examples:
+ # - libdevmapper* from src:lvm2
+ # - linux-image-* from src:linux-latest
+ #
+ # In this case we have to extract the source version which is stored between
+ # parentheses in the Source field.
+
+ # Easy as the default:
my $s_v = "$p = $v";
+ # Let's now look whether we are in the Hard or Medium cases:
if ($s and $s =~ /^(.*) [(](.*)[)]$/) {
$s_v = "$1 = $2";
}