[devscripts] 01/02: licensecheck: Handle differing lengths of comment leaders.
James McCoy
jamessan at debian.org
Sat Aug 3 03:35:03 UTC 2013
This is an automated email from the git hooks/post-receive script.
jamessan pushed a commit to branch master
in repository devscripts.
commit 914fe83d5ac3e4a1fb73c170d5f6a3c0c8e97576
Author: James McCoy <jamessan at debian.org>
Date: Thu Aug 1 22:11:23 2013 -0400
licensecheck: Handle differing lengths of comment leaders.
Closes: #714835
Signed-off-by: James McCoy <jamessan at debian.org>
---
debian/changelog | 5 ++++-
scripts/licensecheck.pl | 3 +--
test/licensecheck/gpl-3+.el | 20 ++++++++++++++++++++
test/test_licensecheck | 1 +
4 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index df61492..f1065d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,7 +20,10 @@ devscripts (2.13.3) UNRELEASED; urgency=low
Dmitry Smirnov for the patch. (Closes: #712261)
* transition-check: Work around Pod::Simple change which causes Perl 5.18's
pod2man to fail. (Closes: #714599)
- * licensecheck: Check haskell files. Thanks to Jens Petersen for the patch.
+ * licensecheck:
+ + Check haskell files. Thanks to Jens Petersen for the patch.
+ + Handle differing lengths of comment leaders when autodetecting comments.
+ (Closes: #714835)
* uscan/rc-alert: Fix roff errors in man pages. Thanks to Eric S. Raymond
for the patch. (Closes: #712701)
diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 80d3bf4..62be07c 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -359,8 +359,7 @@ sub clean_comments {
# if no such pattern found.
my @matches = m/^\s*([^a-zA-Z0-9\s]{1,3})\s\w/mg;
if (@matches >= 4) {
- my $comment_length = length($matches[0]);
- my $comment_re = qr/\s*[\Q$matches[0]\E]{${comment_length}}\s*/;
+ my $comment_re = qr/\s*[\Q$matches[0]\E]{1,3}\s*/;
s/^$comment_re//mg;
}
diff --git a/test/licensecheck/gpl-3+.el b/test/licensecheck/gpl-3+.el
new file mode 100644
index 0000000..cd59103
--- /dev/null
+++ b/test/licensecheck/gpl-3+.el
@@ -0,0 +1,20 @@
+;;; db-lemacs.el --- part of EDB, the Emacs database
+
+;; Copyright (C) 2004,2005,2006,2007,2008 Thien-Thi Nguyen
+
+;; This file is part of EDB.
+;;
+;; EDB is free software; you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free
+;; Software Foundation; either version 3, or (at your option) any later
+;; version.
+;;
+;; EDB is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+;; for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with EDB; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+;; MA 02110-1301, USA.
diff --git a/test/test_licensecheck b/test/test_licensecheck
index 93657c5..fdf2db7 100755
--- a/test/test_licensecheck
+++ b/test/test_licensecheck
@@ -62,6 +62,7 @@ testGPL() {
license "gpl-3+" "GPL (v3 or later)"
license "gpl-3-only.c" "GPL (v3)"
license "gpl-variation.c" "GPL (v3 or later)"
+ license "gpl-3+.el" "GPL (v3 or later)"
}
testDual() {
--
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