]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_strip
* dh_shlibdeps: Update documentation for -L and -l. dpkg-shlibdeps is now
[debhelper.git] / dh_strip
index 63df046609beea033c9b337ba0e9505b79760a1b..2c7f3d8f45097cb15646987f1ede0e30a9255d0f 100755 (executable)
--- a/dh_strip
+++ b/dh_strip
@@ -48,7 +48,7 @@ Causes dh_strip to save debug symbols stripped from the packages it acts on
 as independent files in the package build directory of the specified debugging
 package.
 
-For example, if your packages are lifoo and foo and you want to include a
+For example, if your packages are libfoo and foo and you want to include a
 foo-dbg package with debugging symbols, use dh_strip --dbg-package=foo-dbg.
 
 Note that this option behaves significantly different in debhelper
@@ -57,24 +57,19 @@ package to put symbols in, it specifies a package (or packages) which
 should have separated debug symbols, and the separated symbols are placed
 in packages with "-dbg" added to their name.
 
-Note that if you use this option, your package should build-depend on
-binutils (>= 2.14.90.0.7).
-
 =item B<-k>, B<--keep-debug>
 
 Debug symbols will be retained, but split into an independent
 file in usr/lib/debug/ in the package build directory. --dbg-package
 is easier to use than this option, but this option is more flexible.
 
-Note that if you use this option, your package should build-depend on
-binutils (>= 2.12.90.0.9).
-
 =back
 
 =head1 NOTES
 
 If the DEB_BUILD_OPTIONS environment variable contains "nostrip", nothing
-will be stripped, in accordance with Debian policy.
+will be stripped, in accordance with Debian policy (section 10.1
+"Binaries").
 
 =head1 CONFORMS TO
 
@@ -161,7 +156,9 @@ sub make_debug {
        if (! -d $debug_dir) {
                doit("install", "-d", $debug_dir);
        }
-       doit("objcopy", "--only-keep-debug", $file, $debug_path);
+       if (! -e $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;
@@ -184,7 +181,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        $keep_debug=1;
                        # Note that it's only an array for the v4 stuff;
                        # for v5 only one value is used.
-                       $debugtmp=tmpdir(@{$dh{DEBUGPACKAGES}}[0]);
+                       my $debugpackage=@{$dh{DEBUGPACKAGES}}[0];
+                       if (! grep { $_ eq $debugpackage } getpackages()) {
+                               error("debug package $debugpackage is not listed in the control file");
+                       }
+                       $debugtmp=tmpdir($debugpackage);
                }
        }
        else {