license_trailer: avoid bogus bare "GPL" matches
authorIan Beckwith <ianb@erislabs.net>
Tue, 15 Sep 2009 05:18:05 +0000 (06:18 +0100)
committerIan Beckwith <ianb@erislabs.net>
Tue, 15 Sep 2009 05:18:05 +0000 (06:18 +0100)
debian/clscan/clscan
debian/copyright

index 9d6c23b..8aac53b 100755 (executable)
@@ -154,15 +154,14 @@ sub license_trailer
     };
 
     my %types_found=();
-TYPE: for my $type (reverse sort keys(%$license_data))
+    for my $type (reverse sort keys(%$license_data))
     {
        for my $license (@licenses_used)
        {
-           if($license =~ /$type(\+|\b)/i)
+           if($license =~ /$type(\+|\s|$)/i)
            {
                $types_found{$type}=1;
-               # avoid matching eg GPL-2 *and* GPL
-               next TYPE;
+               print "FOUND $type [$license]\n";
            }
        }
     }
@@ -179,10 +178,10 @@ TYPE: for my $type (reverse sort keys(%$license_data))
        # more than one, use table.
        $text .= "The complete text of standard licenses referenced above\n";
        $text .= "can be found in /usr/share/common-licenses/ as follows:\n\n";
-       $text .= sprintf("%-70s %s\n", "LICENSE", "FILE");
+       $text .= sprintf("%-60s %s\n", "LICENSE", "FILE");
        for my $type (sort keys(%types_found))
        {
-           $text .= sprintf("%-70s %s\n", $license_data->{$type}, $type);
+           $text .= sprintf("%-60s %s\n", $license_data->{$type}, $type);
        }
     }
     return $text;
@@ -341,9 +340,9 @@ sub load_overrides
     find({ wanted => \&wanted_modules, no_chdir => 1}, "modules/");
     for my $license (keys(%overrides))
     {
-       print("License: $license\n");
-       print("Files: \n\t");
-       print(join("\n\t", @{$overrides{$license}}),"\n");
+#      print("License: $license\n");
+#      print("Files: \n\t");
+#      print(join("\n\t", @{$overrides{$license}}),"\n");
     }
 }
 
index 144b58d..ed8dd4a 100644 (file)
@@ -3346,13 +3346,10 @@ License: other [REF14]
 The complete text of standard licenses referenced above
 can be found in /usr/share/common-licenses/ as follows:
 
-LICENSE                                                                FILE
-GNU Free Documentation License                                         GFDL
-GNU Free Documentation License Version 1.3                             GFDL-1.3
-GNU General Public License                                             GPL
-GNU General Public License Version 2                                   GPL-2
-GNU General Public License Version 3                                   GPL-3
-GNU Lesser General Public License                                      LGPL
-GNU Library General Public License Version 2                           LGPL-2
-GNU Lesser General Public License Version 2.1                          LGPL-2.1
-GNU Lesser General Public License Version 3                            LGPL-3
+LICENSE                                                      FILE
+GNU Free Documentation License Version 1.3                   GFDL-1.3
+GNU General Public License Version 2                         GPL-2
+GNU General Public License Version 3                         GPL-3
+GNU Library General Public License Version 2                 LGPL-2
+GNU Lesser General Public License Version 2.1                LGPL-2.1
+GNU Lesser General Public License Version 3                  LGPL-3