[Rt-commit] r11697 - rt/branches/3.8-TESTING/sbin

ruz at bestpractical.com ruz at bestpractical.com
Fri Apr 11 16:48:37 EDT 2008


Author: ruz
Date: Fri Apr 11 16:48:35 2008
New Revision: 11697

Modified:
   rt/branches/3.8-TESTING/sbin/license_tag

Log:
* fix tagger

Modified: rt/branches/3.8-TESTING/sbin/license_tag
==============================================================================
--- rt/branches/3.8-TESTING/sbin/license_tag	(original)
+++ rt/branches/3.8-TESTING/sbin/license_tag	Fri Apr 11 16:48:35 2008
@@ -115,13 +115,11 @@
         open(FILE,"<$pm") || die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
-        return if another_license($file);
+        print "$pm - ";
+        return if another_license($file) && print "has different license\n";
 
         my $pmlic = $LICENSE;
         $pmlic =~ s/^/%# /mg;
-
-
-        print "$pm - ";
         if ($file =~ /^%# BEGIN BPS TAGGED BLOCK {{{/ms) {
                 print "has license section";
              $file =~ s/^%# BEGIN BPS TAGGED BLOCK {{{(.*?)%# END BPS TAGGED BLOCK }}}/%# BEGIN BPS TAGGED BLOCK {{{\n$pmlic%# END BPS TAGGED BLOCK }}}/ms;
@@ -149,13 +147,11 @@
         open(FILE,"<$pm") || die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
-        return if another_license($file);
+        print "$pm - ";
+        return if another_license($file) && print "has different license\n";
 
         my $pmlic = $LICENSE;
         $pmlic =~ s/^/# /mg;
-
-
-        print "$pm - ";
         if ($file =~ /^# BEGIN BPS TAGGED BLOCK {{{/ms) {
                 print "has license section";
              $file =~ s/^# BEGIN BPS TAGGED BLOCK {{{(.*?)# END BPS TAGGED BLOCK }}}/# BEGIN BPS TAGGED BLOCK {{{\n$pmlic# END BPS TAGGED BLOCK }}}/ms;
@@ -184,13 +180,11 @@
         open(FILE,"<$pm") || die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
-        return if another_license($file);
+        print "$pm - ";
+        return if another_license($file) && print "has different license\n";
 
         my $pmlic = $LICENSE;
         $pmlic =~ s/^/# /mg;
-
-
-        print "$pm - ";
         if ($file =~ /^# BEGIN BPS TAGGED BLOCK {{{/ms) {
                 print "has license section";
              $file =~ s/^# BEGIN BPS TAGGED BLOCK {{{(.*?)# END BPS TAGGED BLOCK }}}/# BEGIN BPS TAGGED BLOCK {{{\n$pmlic# END BPS TAGGED BLOCK }}}/ms;
@@ -219,12 +213,11 @@
         open(FILE,"<$pm") || die "Failed to open $pm";
         my $file = (join "", <FILE>); 
         close (FILE);
-        return if another_license($file);
+        print "$pm - ";
+        return if another_license($file) && print "has different license\n";
 
         my $pmlic = $LICENSE;
         $pmlic =~ s/^/# /msg;
-
-        print "$pm - ";
         if ($file =~ /^# BEGIN BPS TAGGED BLOCK {{{/ms) {
                 print "has license section";
              $file =~ s/^# BEGIN BPS TAGGED BLOCK {{{(.*?)# END BPS TAGGED BLOCK }}}/# BEGIN BPS TAGGED BLOCK {{{\n$pmlic# END BPS TAGGED BLOCK }}}/ms;
@@ -251,9 +244,9 @@
 
 sub another_license {
     my $file = shift;
-    if ( $file =~ /\bcopyright\b/i && $file !~ /Copyright\s+(c)\s+\d\d\d\d-\d\d\d\d Best Practical Solutions/ ) {
-        return 1;
-    }
+    return 0 if $file =~ /Copyright\s+\(c\)\s+\d\d\d\d-\d\d\d\d Best Practical Solutions/i;
+    return 1 if $file =~ /\bcopyright\b/i; # common
+    return 1 if $file =~ /\(c\)\s+\d\d\d\d(?:-\d\d\d\d)?/i; # prototype
     return 0;
 }
 


More information about the Rt-commit mailing list