diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-01-24 22:04:28 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-24 22:04:28 -0500 |
commit | b91c19fcf670df1b22a92b47e8ed2d435dfb7299 (patch) | |
tree | 99a44c3a52391d1066a9be2564072fc546e2d98f /dh_strip | |
parent | b224e52d143f1937209e518aedde285449fb4631 (diff) |
* dh_strip: Improve the idempotency fix put in for #380314.
* dh_strip: The -k flag didn't work (--keep did). Fix.
Diffstat (limited to 'dh_strip')
-rwxr-xr-x | dh_strip | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -149,6 +149,10 @@ sub make_debug { my $file=shift; my $tmp=shift; my $desttmp=shift; + + # Don't try to copy debug symbols out if the file is already + # stripped. + return unless get_file_type($file) =~ /not stripped/; my ($base_file)=$file=~/^\Q$tmp\E(.*)/; my $debug_path=$desttmp."/usr/lib/debug/".$base_file; @@ -156,9 +160,7 @@ sub make_debug { if (! -d $debug_dir) { doit("install", "-d", $debug_dir); } - if (! -e $debug_path) { - doit("objcopy", "--only-keep-debug", $file, $debug_path); - } + doit("objcopy", "--only-keep-debug", $file, $debug_path); # No reason for this to be executable. doit("chmod", 644, $debug_path); return $debug_path; @@ -174,7 +176,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); # Support for keeping the debugging symbols in a detached file. - my $keep_debug=$dh{KEEP_DEBUG}; + my $keep_debug=$dh{K_FLAG}; my $debugtmp=$tmp; if (! compat(4)) { if (ref $dh{DEBUGPACKAGES}) { @@ -204,14 +206,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # *must* inclde the --strip-unneeded. doit("strip","--remove-section=.comment", "--remove-section=.note","--strip-unneeded",$_); - attach_debug($_, $debug_path) if $keep_debug; + attach_debug($_, $debug_path) if defined $debug_path; } foreach (@executables) { my $debug_path = make_debug($_, $tmp, $debugtmp) if $keep_debug; doit("strip","--remove-section=.comment", "--remove-section=.note",$_); - attach_debug($_, $debug_path) if $keep_debug + attach_debug($_, $debug_path) if defined $debug_path; } foreach (@static_libs) { |