summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog5
-rwxr-xr-xdh_strip14
2 files changed, 14 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 1c6bdb85..b96ce30d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,11 @@ debhelper (9.20160618.1+unreleased) UNRELEASED; urgency=medium
(menu-methods are still installed).
* dh_*: Deprecate -s in favor of -a. The -s option is
removed in compat 11.
+ * dh_strip: Fix regression in 9.20160618, which caused
+ issues when there were hardlinked ELF binaries in a
+ package. Thanks to Sven Joachim for the report, the
+ analysis/testing and for providing a patch for the
+ most common case. (Closes: #829142)
[ Translations ]
* Update German translation (Chris Leick + Eduard Bloch)
diff --git a/dh_strip b/dh_strip
index 7d40c242..2f20dabf 100755
--- a/dh_strip
+++ b/dh_strip
@@ -198,7 +198,7 @@ sub testfile {
# - *.node are also native ELF binaries (for node-js)
if ($fn =~ m/\.(?:so.*?|cmxs|node)$/) {
# Ok, do the expensive test.
- my $type=get_file_type($fn);
+ my $type=get_file_type($fn, 1);
if ($type=~m/ELF.*shared/) {
push @shared_libs, $fn;
return;
@@ -209,7 +209,7 @@ sub testfile {
my (undef,undef,$mode,undef)=stat(_);
if ($mode & 0111) {
# Ok, expensive test.
- my $type=get_file_type($fn);
+ my $type=get_file_type($fn, 1);
if ($type=~m/ELF.*(executable|shared)/) {
push @executables, $fn;
return;
@@ -230,8 +230,8 @@ sub testfile {
# I could just use `file $_[0]`, but this is safer
sub get_file_type {
- my ($file) = @_;
- return $file_output{$file} if $file_output{$file};
+ my ($file, $cache_ok) = @_;
+ return $file_output{$file} if $cache_ok && $file_output{$file};
open (FILE, '-|') # handle all filenames safely
|| exec('file', '-e', 'apptype', '-e', 'ascii', '-e', 'encoding',
'-e', 'cdf', '-e', 'compress', '-e', 'tar', $file)
@@ -247,7 +247,11 @@ sub make_debug {
# Don't try to copy debug symbols out if the file is already
# stripped.
- my $file_info = get_file_type($file);
+ #
+ # Disable caching for non-build-id based extractions.
+ # Unfortunately, it breaks when there are hardlinks to the same
+ # ELF files.
+ my $file_info = get_file_type($file, $use_build_id ? 1 : 0);
return unless $file_info =~ /not stripped/;
if ($use_build_id) {