[devscripts] 02/02: licensecheck: added --tail option
dod at debian.org
dod at debian.org
Sun Dec 6 20:28:14 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 0ba959e57df11500f9cae5694a3be7af3d62b4bd
Author: Dominique Dumont <dod at debian.org>
Date: Sun Dec 6 21:22:54 2015 +0100
licensecheck: added --tail option
to specify tail size (default 5k bytes)
---
scripts/licensecheck.pl | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 3a81475..71ee736 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -58,6 +58,12 @@ Default is to be quiet.
Specify the number of lines of each file's header which should be parsed
for license information. (Default is 60).
+=item B<--tail=>I<N>
+
+By default, the last 5k bytes of each files are parsed to get license
+information. You may use this option to set the size of this parsed chunk.
+You may set this value to 0 to avoid parsing the end of the file.
+
=item B<-i=>I<regex>, B<--ignore=>I<regex>
When processing the list of files and directories, the regular
@@ -278,6 +284,7 @@ GetOptions(\%OPT,
"machine|m",
"noconf|no-conf",
"recursive|r",
+ "tail",
"text|t",
"verbose!",
"version|v",
@@ -359,7 +366,7 @@ while (@files) {
if ( not $copyright and $license eq 'UNKNOWN') {
my $position = $fh->tell; # See IO::Seekable
- my $tail_size = $def_tail;
+ my $tail_size = $OPT{tail} // $def_tail;
my $jump = $st->size - $tail_size;
$jump = $position if $jump < $position;
@@ -505,6 +512,8 @@ Valid options are:
--lines, -l Specify how many lines of the file header
should be parsed for license information
(Default: $def_lines)
+ --tail Specify how many bytes to parse at end of file
+ (Default: $def_tail)
--check, -c Specify a pattern indicating which files should
be checked
(Default: '$default_check_regex')
--
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