[debhelper-devel] [debhelper] 02/09: Replace $dh{DEBUGPACKAGES} with $dh{DEBUGPACKAGE}
Niels Thykier
nthykier at moszumanska.debian.org
Wed Jun 15 20:29:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 01480c11661204b6833608317928a6365e8a4cc4
Author: Niels Thykier <niels at thykier.net>
Date: Tue Jun 14 18:23:45 2016 +0000
Replace $dh{DEBUGPACKAGES} with $dh{DEBUGPACKAGE}
All uses are now singular, so change the code to only accept one
package (the latest passed) and only store one value.
The original $dh{DEBUGPACKAGES} is preserved for backwards
compatibility (e.g. dh_clistrip uses it), although it will now always
have at most one value in the array.
Signed-off-by: Niels Thykier <niels at thykier.net>
---
Debian/Debhelper/Dh_Getopt.pm | 10 ++++++----
dh_strip | 8 ++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index c7d9c3c..e597ddb 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -42,9 +42,11 @@ sub AddPackage { my($option,$value)=@_;
}
}
-# Adds packages to the list of debug packages.
-sub AddDebugPackage { my($option,$value)=@_;
- push @{$dh{DEBUGPACKAGES}}, $value;
+# Sets a package as the debug package.
+sub SetDebugPackage { my($option,$value)=@_;
+ $dh{DEBUGPACKAGE} = $value;
+ # For backwards compatibility
+ $dh{DEBUGPACKAGES} = [$value];
}
# Add a package to a list of packages that should not be acted on.
@@ -96,7 +98,7 @@ sub getoptions {
"remaining-packages" => \$dh{EXCLUDE_LOGGED},
- "dbg-package=s" => \&AddDebugPackage,
+ "dbg-package=s" => \&SetDebugPackage,
"s" => \&AddPackage,
"same-arch" => \&AddPackage,
diff --git a/dh_strip b/dh_strip
index 615ba1c..6ac0227 100755
--- a/dh_strip
+++ b/dh_strip
@@ -294,9 +294,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $keep_debug=$dh{K_FLAG};
my $debugtmp=$tmp;
my $use_build_id = compat(8) ? 0 : 1;
- if (ref $dh{DEBUGPACKAGES}) {
+ if ($dh{DEBUGPACKAGE}) {
$keep_debug=1;
- my $debugpackage=@{$dh{DEBUGPACKAGES}}[0];
+ my $debugpackage=$dh{DEBUGPACKAGE};
if (!$all_packages{$debugpackage}) {
error("debug package $debugpackage is not listed in the control file");
}
@@ -360,12 +360,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
close($fd) or error("close $path failed: $!");
}
}
- if (@build_ids && ($use_build_id > 1 || ref($dh{DEBUGPACKAGES}))) {
+ if (@build_ids && ($use_build_id > 1 || $dh{DEBUGPACKAGE})) {
my ($dir, $path);
if ($use_build_id > 1) {
$dir = "debian/.debhelper/${package}";
} else {
- my $dbg_pkg = @{$dh{DEBUGPACKAGES}}[0];
+ my $dbg_pkg = $dh{DEBUGPACKAGE};
$dir = "debian/.debhelper/${dbg_pkg}";
}
$path = "${dir}/dbgsym-build-ids";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list