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 /scripts/dpkg-source.pl | |
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
Diffstat (limited to 'scripts/dpkg-source.pl')
-rwxr-xr-x | scripts/dpkg-source.pl | 12 |
1 files changed, 12 insertions, 0 deletions
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'); |