[SCM] Git repository for devscripts branch, master, updated. v2.12.3-7-g1457388
Benjamin Drung
bdrung at debian.org
Wed Sep 19 12:32:52 UTC 2012
The following commit has been merged in the master branch:
commit 963cf447d0ed4c3ec37ba7b0cdcc42ab4ec1183c
Author: Benjamin Drung <bdrung at debian.org>
Date: Wed Sep 19 14:24:46 2012 +0200
Recognize licenses in (fixed-form) Fortran code.
Closes: #687452
Thanks: Francesco Poli
diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 26740e1..d98b974 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -4,6 +4,7 @@
#
# This version is
# Copyright (C) 2007, 2008 Adam D. Barratt
+# Copyright (C) 2012 Francesco Poli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -299,11 +300,12 @@ while (@files) {
print qq(----- $file header -----\n$content----- end header -----\n\n)
if $opt_verbose;
+ # Remove Fortran comments
+ $content =~ s/^[cC] //gm;
$content =~ tr/\t\r\n/ /;
# Remove C / C++ comments
$content =~ s#(\*/|/[/*])##g;
$content =~ tr% A-Za-z.,@;0-9\(\)/-%%cd;
- $content =~ s/ c //g; # Remove fortran comments
$content =~ tr/ //s;
$license = parselicense($content);
diff --git a/test/licensecheck/bsd.f b/test/licensecheck/bsd.f
new file mode 100644
index 0000000..87f372f
--- /dev/null
+++ b/test/licensecheck/bsd.f
@@ -0,0 +1,25 @@
+c Copyright (c) 2012, Devscripts developers
+c
+c Redistribution and use in source and binary forms, with or without
+c modification, are permitted provided that the following conditions are
+c met:
+c
+c - Redistributions of source code must retain the above copyright
+c notice, this list of conditions and the following disclaimer.
+c
+c - Redistributions in binary form must reproduce the above copyright
+c notice, this list of conditions and the following disclaimer in the
+c documentation and/or other materials provided with the
+c distribution.
+c
+c THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+c IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+c PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+c HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+c SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+c LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+c DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+c THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+c (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+c OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/test/test_licensecheck b/test/test_licensecheck
index e7178df..73c6c91 100755
--- a/test/test_licensecheck
+++ b/test/test_licensecheck
@@ -54,4 +54,8 @@ testMachine() {
license2 "-m --copyright" "gpl-2" "GPL (v2) 2012 Devscripts developers"
}
+testFortranComments() {
+ license "bsd.f" "BSD (2 clause)"
+}
+
. shunit2
--
Git repository for devscripts
More information about the devscripts-devel
mailing list