Package: dpkg
Severity: normal

Package: dpkg
Version: 1.16.2
Severity: wishlist
Tags: patch

Patch updated to work on dpkg-1.16.2.

-- System Information:
Debian Release: 6.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/1 CPU core)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg depends on:
ii  coreutils               8.5-1            GNU core utilities
ii  libbz2-1.0              1.0.5-6+squeeze1 high-quality block-sorting file co
ii  libc6                   2.11.3-3         Embedded GNU C Library: Shared lib
ii  libselinux1             2.0.96-1         SELinux runtime shared libraries
ii  xz-utils                5.0.0-2          XZ-format compression utilities
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                    0.8.10.3+squeeze1 Advanced front-end for dpkg

-- no debconf information
diff -Nur dpkg-1.16.2.orig/scripts/Dpkg/Control/Fields.pm dpkg-1.16.2/scripts/Dpkg/Control/Fields.pm
--- dpkg-1.16.2.orig/scripts/Dpkg/Control/Fields.pm	2012-03-19 06:40:08.000000000 +0000
+++ dpkg-1.16.2/scripts/Dpkg/Control/Fields.pm	2012-04-12 11:16:18.130605298 +0000
@@ -73,10 +73,20 @@
         dependency => 'normal',
         dep_order => 1,
     },
+    'Build-Depends-Stage1' => {
+        allowed => ALL_SRC,
+        dependency => 'normal',
+        dep_order => 1,
+    },
     'Build-Depends-Indep' => {
         allowed => ALL_SRC,
         dependency => 'normal',
         dep_order => 2,
+    },
+    'Build-Depends-Indep-Stage1' => {
+        allowed => ALL_SRC,
+        dependency => 'normal',
+        dep_order => 2,
     },
     'Built-Using' => {
         allowed => ALL_PKG,
diff -Nur dpkg-1.16.2.orig/scripts/dpkg-buildpackage.pl dpkg-1.16.2/scripts/dpkg-buildpackage.pl
--- dpkg-1.16.2.orig/scripts/dpkg-buildpackage.pl	2012-03-19 06:40:09.000000000 +0000
+++ dpkg-1.16.2/scripts/dpkg-buildpackage.pl	2012-04-12 11:20:05.046605849 +0000
@@ -123,6 +123,7 @@
 my $targetarch = my $targetgnusystem = '';
 my $call_target = '';
 my $call_target_as_root = 0;
+my $buildstage = 0;
 my (@checkbuilddep_opts, @changes_opts, @source_opts);
 
 use constant BUILD_DEFAULT    => 1;
@@ -298,6 +299,11 @@
     $build_opts->set("parallel", $parallel);
     $build_opts->export();
 }
+if (defined $buildstage) {
+    $buildstage = $build_opts->get("stage") if $build_opts->has("stage");
+    $build_opts->set("stage", $buildstage);
+    $build_opts->export();
+}
 
 my $cwd = cwd();
 my $dir = basename($cwd);
@@ -362,6 +368,9 @@
     if ($admindir) {
 	push @checkbuilddep_opts, "--admindir=$admindir";
     }
+    if ($buildstage) {
+	push @checkbuilddep_opts, "--stage=$buildstage";
+    }
 
     system('dpkg-checkbuilddeps', @checkbuilddep_opts);
     if (not WIFEXITED($?)) {
diff -Nur dpkg-1.16.2.orig/scripts/dpkg-checkbuilddeps.pl dpkg-1.16.2/scripts/dpkg-checkbuilddeps.pl
--- dpkg-1.16.2.orig/scripts/dpkg-checkbuilddeps.pl	2012-03-19 06:40:09.000000000 +0000
+++ dpkg-1.16.2/scripts/dpkg-checkbuilddeps.pl	2012-04-12 11:24:22.574629827 +0000
@@ -51,6 +51,8 @@
   -a arch        assume given host architecture
   --admindir=<directory>
                  change the administrative directory.
+  --stage=<level>
+                 use build-depends-stage level specified
   -h, --help     show this help message.
       --version  show the version.")
 	. "\n\n" . _g(
@@ -61,13 +63,15 @@
 my $binary_only=0;
 my ($bd_value, $bc_value);
 my $host_arch = get_host_arch();
+my $buildstage=0;
 if (!GetOptions('B' => \$binary_only,
                 'help|h' => sub { usage(); exit(0); },
                 'version' => \&version,
                 'd=s' => \$bd_value,
                 'c=s' => \$bc_value,
                 'a=s' => \$host_arch,
-                'admindir=s' => \$admindir)) {
+                'admindir=s' => \$admindir,
+                'stage=s' => \$buildstage)) {
 	usage();
 	exit(2);
 }
@@ -80,10 +84,16 @@
 my $facts = parse_status("$admindir/status");
 
 unless (defined($bd_value) or defined($bc_value)) {
+    my $BD_key="Build-Depends";
+    my $BDI_key="Build-Depends-Indep";
+    if ($buildstage) {
+       $BD_key="Build-Depends-Stage".$buildstage;
+       $BDI_key="Build-Depends-Indep-Stage".$buildstage;
+    }
     $bd_value = 'build-essential';
-    $bd_value .= ", " . $fields->{"Build-Depends"} if defined $fields->{"Build-Depends"};
-    if (not $binary_only and defined $fields->{"Build-Depends-Indep"}) {
-	$bd_value .= ", " . $fields->{"Build-Depends-Indep"};
+    $bd_value .= ", " . $fields->{$BD_key} if defined $fields->{$BD_key};
+    if (not $binary_only and defined $fields->{$BDI_key}) {
+       $bd_value .= ", " . $fields->{$BDI_key};
     }
     $bc_value = $fields->{"Build-Conflicts"} if defined $fields->{"Build-Conflicts"};
     if (not $binary_only and defined $fields->{"Build-Conflicts-Indep"}) {

Reply via email to