Browse Source

dpkg-source: Add arch and profile information to Package-List field

Add two new optional values to the Packages-List field, with
architecture and build-profiles information. These values have the
form «name=value1,value2», and might appear in any order after the
mandatory values.

This allows to run bootstrapping analysis over the Sources package
indices.

Requested-by: Johannes Schauer <j.schauer@email.de>
Suggested-by: Raphaël Hertzog <hertzog@debian.org>
Guillem Jover 12 years ago
parent
commit
03dc67940a
3 changed files with 18 additions and 1 deletions
  1. 4 0
      debian/changelog
  2. 4 0
      scripts/Dpkg/Control/FieldsCore.pm
  3. 10 1
      scripts/dpkg-source.pl

+ 4 - 0
debian/changelog

@@ -32,6 +32,10 @@ dpkg (1.17.7) UNRELEASED; urgency=low
     Thanks to Moritz Muehlenhoff <jmm@debian.org>. Closes: #738310
   * Add a new dpkg-source extraction --ignore-bad-version option.
     Closes: #740883
+  * Add Architecture and Build-Profiles information to Package-List field,
+    as optional name=value1,value2 entries, with names «arch» and «profile».
+    Use the now recognized field Build-Profiles from binary stanzas in the
+    source control file to fill the «profile» value.
 
   [ Updated dpkg translations ]
   * German (Sven Joachim).

+ 4 - 0
scripts/Dpkg/Control/FieldsCore.pm

@@ -111,6 +111,10 @@ our %FIELDS = (
         dependency => 'normal',
         dep_order => 3,
     },
+    'Build-Profiles' => {
+        allowed => CTRL_INFO_PKG,
+        separator => FIELD_SEP_SPACE,
+    },
     'Built-For-Profiles' => {
         allowed => ALL_PKG | CTRL_FILE_CHANGES,
         separator => FIELD_SEP_SPACE,

+ 10 - 1
scripts/dpkg-source.pl

@@ -267,7 +267,16 @@ if ($options{opmode} =~ /^(-b|--print-format|--(before|after)-build|--commit)$/)
 	my $prio = $pkg->{'Priority'} || $src_prio;
 	my $type = $pkg->{'Package-Type'} ||
 	        $pkg->get_custom_field('Package-Type') || 'deb';
-	push @pkglist, sprintf('%s %s %s %s', $p, $type, $sect, $prio);
+        my $arch = $pkg->{'Architecture'};
+        my $profile = $pkg->{'Build-Profiles'};
+
+        my $pkg_summary = sprintf('%s %s %s %s', $p, $type, $sect, $prio);
+
+        $pkg_summary .= ' arch=' . join ',', split /\s+/, $arch;
+        $pkg_summary .= ' profile=' . join ',', split /\s+/, $profile
+            if defined $profile;
+
+        push @pkglist, $pkg_summary;
 	push @binarypackages, $p;
 	foreach (keys %{$pkg}) {
 	    my $v = $pkg->{$_};