[debhelper-devel] [debhelper] 02/05: dh_strip/dh_makeshlibs: Move cross_commands into DOPACKAGES loops
Niels Thykier
nthykier at moszumanska.debian.org
Sat Nov 11 08:03:29 UTC 2017
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit d17743c412863ac7398a2c76979453ef4ef49a33
Author: Niels Thykier <niels at thykier.net>
Date: Sat Oct 21 14:12:42 2017 +0000
dh_strip/dh_makeshlibs: Move cross_commands into DOPACKAGES loops
Signed-off-by: Niels Thykier <niels at thykier.net>
---
dh_makeshlibs | 4 ++--
dh_strip | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dh_makeshlibs b/dh_makeshlibs
index 533c042..9c6b4da 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -138,8 +138,6 @@ init(options => {
"add-udeb=s" => \$dh{SHLIBS_UDEB},
});
-my $objdump=cross_command("objdump");
-
my $ok=1;
foreach my $package (@{$dh{DOPACKAGES}}) {
@@ -147,6 +145,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp=tmpdir($package);
+ my $objdump=cross_command("objdump");
+
my (%seen, $unversioned_so);
my $need_ldconfig = 0;
my $shlibs_file = pkgfile($package, 'shlibs');
diff --git a/dh_strip b/dh_strip
index 11ca472..14b5db7 100755
--- a/dh_strip
+++ b/dh_strip
@@ -165,8 +165,6 @@ if ($dh{MIGRATE_DBGSYM} and not $dh{ENABLE_DBGSYM}) {
# This variable can be used to turn off stripping (see Policy).
exit 0 if (get_buildoption('nostrip'));
-my $objcopy = cross_command("objcopy");
-my $strip = cross_command("strip");
my $no_auto_dbgsym = 0;
$no_auto_dbgsym = 1 if get_buildoption('noautodbgsym') or get_buildoption('noddebs');
@@ -261,7 +259,7 @@ sub get_file_type {
}
sub make_debug {
- my ($file, $tmp, $desttmp, $use_build_id) = @_;
+ my ($objcopy, $file, $tmp, $desttmp, $use_build_id) = @_;
my ($debug_path, $debug_build_id);
# Don't try to copy debug symbols out if the file is already
@@ -305,7 +303,7 @@ sub make_debug {
}
sub attach_debug {
- my ($file, $debug_path) = @_;
+ my ($objcopy, $file, $debug_path) = @_;
doit($objcopy, "--add-gnu-debuglink", $debug_path, $file);
}
@@ -314,6 +312,8 @@ my %all_packages = map { $_ => 1 } getpackages();
sub process_packages {
foreach my $package (@_) {
my $tmp=tmpdir($package);
+ my $objcopy = cross_command("objcopy");
+ my $strip = cross_command("strip");
# Support for keeping the debugging symbols in a detached file.
my $keep_debug=$dh{K_FLAG};
@@ -344,17 +344,17 @@ sub process_packages {
}, $tmp);
foreach (@shared_libs) {
- my $debug_path = make_debug($_, $tmp, $debugtmp, $use_build_id) if $keep_debug;
+ my $debug_path = make_debug($objcopy, $_, $tmp, $debugtmp, $use_build_id) if $keep_debug;
# Note that all calls to strip on shared libs
# *must* include the --strip-unneeded.
doit($strip, "--remove-section=.comment", "--remove-section=.note", "--strip-unneeded", $_);
- attach_debug($_, $debug_path) if defined $debug_path;
+ attach_debug($objcopy, $_, $debug_path) if defined $debug_path;
}
foreach (@executables) {
my $debug_path = make_debug($_, $tmp, $debugtmp, $use_build_id) if $keep_debug;
doit($strip, "--remove-section=.comment", "--remove-section=.note", $_);
- attach_debug($_, $debug_path) if defined $debug_path;
+ attach_debug($objcopy, $_, $debug_path) if defined $debug_path;
}
if (@static_libs) {
--
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