]> git.donarmstrong.com Git - debhelper.git/commitdiff
* dh_strip: Improve the idempotency fix put in for #380314.
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 25 Jan 2008 03:04:28 +0000 (22:04 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 25 Jan 2008 03:04:28 +0000 (22:04 -0500)
* dh_strip: The -k flag didn't work (--keep did). Fix.

Debian/Debhelper/Dh_Getopt.pm
debian/changelog
dh_strip

index d1e052affba85501c5ca5fc72189f76f432c05b4..6f95dd35bf844c4f77757059d92d7440fac7409a 100644 (file)
@@ -121,6 +121,7 @@ sub parseopts {
        
                "k" => \$options{K_FLAG},
                "keep" => \$options{K_FLAG},
+               "keep-debug" => \$options{K_FLAG},
 
                "P=s" => \$options{TMPDIR},
                "tmpdir=s" => \$options{TMPDIR},
@@ -169,8 +170,6 @@ sub parseopts {
                
                "name=s" => \$options{NAME},
                
-               "keep-debug" => \$options{KEEP_DEBUG},
-               
                "error-handler=s" => \$options{ERROR_HANDLER},
                
                "add-udeb=s" => \$options{SHLIBS_UDEB},
index 23a45ef3293e0e719f8771670b640c0e471b750f..6b5b8ea4be6eb1e96517fefb99f0af7d711e764b 100644 (file)
@@ -1,3 +1,10 @@
+debhelper (6.0.4) UNRELEASED; urgency=low
+
+  * dh_strip: Improve the idempotency fix put in for #380314.
+  * dh_strip: The -k flag didn't work (--keep did). Fix.
+
+ -- Joey Hess <joeyh@debian.org>  Thu, 24 Jan 2008 21:39:37 -0500
+
 debhelper (6.0.3) unstable; urgency=low
 
   * dh_link: -X can be used to avoid it modifying symlinks to be compliant
index 2c7f3d8f45097cb15646987f1ede0e30a9255d0f..2796f9afb1d91645ed9e43e88ab92141cc82f06b 100755 (executable)
--- a/dh_strip
+++ b/dh_strip
@@ -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) {