diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2011-03-24 14:39:56 +0100 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2011-03-24 14:48:12 +0100 |
commit | 014672432452a6f6a18c44e733fece7938685370 (patch) | |
tree | 1216e9944ab367b5e6b546de70b5f984c689eaae | |
parent | d291a98bce9ecf04ae7f35262453b038dc17cf04 (diff) | |
download | dpkg-014672432452a6f6a18c44e733fece7938685370.tar.gz |
dpkg-source: add new Package-List field to .dsc files
This field has been requested by ftpmasters so that they can install
overrides for all binary packages as soon as they have approved
the source package. It contains a the list of packages that the source
can build along with their sections and priorities.
It looks like this:
Package-List:
src:foo admin optional
foo admin optional
foo-common admin optional
udeb:foo-udeb debian-installer extra
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | scripts/Dpkg/Control/Fields.pm | 6 | ||||
-rwxr-xr-x | scripts/dpkg-source.pl | 12 |
3 files changed, 20 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index bf542c943..427bfa621 100644 --- a/debian/changelog +++ b/debian/changelog @@ -92,6 +92,9 @@ dpkg (1.16.0) UNRELEASED; urgency=low spotting it. * Use the correct mtime when installing a file with statoverrides. LP: #739179 + * Add new Package-List field to .dsc files as requested by ftpmasters. + It contains a the list of packages that the source builds along with + their sections and priorities. Closes: #619131 [ Jonathan Nieder ] * Remove support for use of synchronous sync(2), due to its pernicious diff --git a/scripts/Dpkg/Control/Fields.pm b/scripts/Dpkg/Control/Fields.pm index 6f3e319ef..d7d7dcf5d 100644 --- a/scripts/Dpkg/Control/Fields.pm +++ b/scripts/Dpkg/Control/Fields.pm @@ -161,6 +161,9 @@ our %FIELDS = ( 'Package' => { allowed => ALL_PKG, }, + 'Package-List' => { + allowed => ALL_SRC & ~CTRL_INFO_SRC, + }, 'Package-Type' => { allowed => ALL_PKG, }, @@ -288,7 +291,8 @@ our %FIELD_ORDER = ( qw(Format Source Binary Architecture Version Origin Maintainer Uploaders Homepage Standards-Version Vcs-Browser Vcs-Arch Vcs-Bzr Vcs-Cvs Vcs-Darcs Vcs-Git Vcs-Hg Vcs-Mtn - Vcs-Svn), &field_list_src_dep(), @checksum_fields, qw(Files) + Vcs-Svn), &field_list_src_dep(), qw(Package-List), + @checksum_fields, qw(Files) ], CTRL_FILE_CHANGES() => [ qw(Format Date Source Binary Architecture Version Distribution diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 5d4c1de6e..7fa8b7192 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -220,6 +220,10 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { # Scan control info of source package my $src_fields = $control->get_source(); + my $src_sect = $src_fields->{'Section'} || "unknown"; + my $src_prio = $src_fields->{'Priority'} || "unknown"; + $fields->{'Package-List'} = sprintf("\nsrc:%s %s %s", $src_fields->{'Source'}, + $src_sect, $src_prio); foreach $_ (keys %{$src_fields}) { my $v = $src_fields->{$_}; if (m/^Source$/i) { @@ -242,8 +246,15 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { } # Scan control info of binary packages + my @pkglist; foreach my $pkg ($control->get_packages()) { my $p = $pkg->{'Package'}; + my $sect = $pkg->{'Section'} || $src_sect; + 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", ($type eq "deb") ? "" : "$type:", + $p, $sect, $prio); push(@binarypackages,$p); foreach $_ (keys %{$pkg}) { my $v = $pkg->{$_}; @@ -272,6 +283,7 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { } } } + $fields->{'Package-List'} .= "\n" . join("\n", sort @pkglist); if (grep($_ eq 'any', @sourcearch)) { # If we encounter one 'any' then the other arches become insignificant. @sourcearch = ('any'); |