[debhelper-devel] [debhelper] 01/01: dh_strip: Pass -e to file to avoid unncessary tests

Niels Thykier nthykier at moszumanska.debian.org
Wed Jun 15 20:40:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 6ed70b284834316657fa80de154d96be1d9a1154
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Jun 15 20:39:30 2016 +0000

    dh_strip: Pass -e to file to avoid unncessary tests
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog | 2 ++
 dh_strip         | 7 +++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index db04957..6d35039 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -49,6 +49,8 @@ debhelper (9.20160403+unreleased) UNRELEASED; urgency=medium
   * Dh_Lib.pm: Add better error messages when a debhelper program
     fails due to an executable config file not terminating with
     success.  (Closes: #818933)
+  * dh_strip: Pass -e to file(1) to skip tests for file formats
+    that dh_strip does not care about.
 
  -- Niels Thykier <niels at thykier.net>  Sat, 09 Apr 2016 09:20:32 +0000
 
diff --git a/dh_strip b/dh_strip
index a2c9dcb..8d00e97 100755
--- a/dh_strip
+++ b/dh_strip
@@ -231,11 +231,10 @@ sub testfile {
 # I could just use `file $_[0]`, but this is safer
 sub get_file_type {
 	my ($file) = @_;
-	if ($file_output{$file}) {
-		return $file_output{$file};
-	}
+	return $file_output{$file} if $file_output{$file};
 	open (FILE, '-|') # handle all filenames safely
-		|| exec('file', $file)
+		|| exec('file', '-e', 'apptype', '-e', 'ascii', '-e', 'encoding',
+				'-e', 'cdf', '-e', 'compress', '-e', 'tar', $file)
 		|| die "can't exec file: $!";
 	my $type=<FILE>;
 	close FILE;

-- 
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