[devscripts] 01/01: licensecheck: added --text option to avoid binaries

dod at debian.org dod at debian.org
Mon Sep 7 11:47:22 UTC 2015


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

dod pushed a commit to branch master
in repository devscripts.

commit e5500d37a2f19874f607a961045c6c0c08f3dadb
Author: Dominique Dumont <dod at debian.org>
Date:   Mon Sep 7 13:46:01 2015 +0200

    licensecheck: added --text option to avoid binaries
---
 debian/changelog        |  1 +
 scripts/licensecheck.pl | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 64cfcf4..6a9040b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,7 @@ devscripts (2.15.9) UNRELEASED; urgency=medium
 
   [ Dominique Dumont ]
   * licensecheck:
+    * added --text option to avoid scanning binary files
     * use 'file' command to decide whether to scan a file or
       not (instead of testing file suffix)
     * remove trailing '#' from © information
diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 3f6a4d4..3d1ff2e 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -74,8 +74,11 @@ recursively.
 Specify a pattern against which filenames will be matched in order to
 decide which files to check the license of.
 
-By default, all files of mime type C<text/*> and C<application/xml>
-are parsed. The mime type is given by C<file> command.
+=item B<-t>, B<--text>
+
+By default, all files are parsed, including binary files. This option
+limits the parsed files to mime type C<text/*> and C<application/xml>.
+The mime type is given by C<file> command.
 
 =item B<--copyright>
 
@@ -218,6 +221,7 @@ my %OPT=(
     recursive      => 0,
     copyright      => 0,
     machine        => 0,
+    text           => 0,
 );
 
 my $def_lines = 60;
@@ -275,6 +279,7 @@ GetOptions(\%OPT,
            "machine|m",
            "noconf|no-conf",
            "recursive|r",
+	   "text|t",
            "verbose!",
            "version|v",
 ) or die "Usage: $progname [options] filelist\nRun $progname --help for more details\n";
@@ -345,6 +350,7 @@ while (@files) {
 	chomp $mime;
 	warn "$0 warning: cannot parse file '$file' with mime type '$mime'\n";
 	$charset = 'maybe-binary';
+	next if $OPT{text};
     }
 
     open (my $F, '<' ,$file) or die "Unable to access $file\n";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list