4 # BEGIN BPS TAGGED BLOCK {{{
8 # This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
9 # <sales@bestpractical.com>
11 # (Except where explicitly superseded by other copyright notices)
16 # This work is made available to you under the terms of Version 2 of
17 # the GNU General Public License. A copy of that license should have
18 # been provided with this software, but in any event can be snarfed
21 # This work is distributed in the hope that it will be useful, but
22 # WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 # General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 # 02110-1301 or visit their web page on the internet at
30 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
33 # CONTRIBUTION SUBMISSION POLICY:
35 # (The following paragraph is not intended to limit the rights granted
36 # to you to modify and distribute this software under the terms of
37 # the GNU General Public License and is only of importance to you if
38 # you choose to contribute your changes and enhancements to the
39 # community by submitting them to Best Practical Solutions, LLC.)
41 # By intentionally submitting any modifications, corrections or
42 # derivatives to this work, or any other work intended for use with
43 # Request Tracker, to Best Practical Solutions, LLC, you confirm that
44 # you are the copyright holder for those contributions and you grant
45 # Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
46 # royalty-free, perpetual, license to use, copy, create derivative
47 # works based on those contributions, and sublicense and distribute
48 # those contributions and any derivatives thereof.
50 # END BPS TAGGED BLOCK }}}
51 my $LICENSE = <<'EOL';
55 This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
56 <sales@bestpractical.com>
58 (Except where explicitly superseded by other copyright notices)
63 This work is made available to you under the terms of Version 2 of
64 the GNU General Public License. A copy of that license should have
65 been provided with this software, but in any event can be snarfed
68 This work is distributed in the hope that it will be useful, but
69 WITHOUT ANY WARRANTY; without even the implied warranty of
70 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
71 General Public License for more details.
73 You should have received a copy of the GNU General Public License
74 along with this program; if not, write to the Free Software
75 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
76 02110-1301 or visit their web page on the internet at
77 http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
80 CONTRIBUTION SUBMISSION POLICY:
82 (The following paragraph is not intended to limit the rights granted
83 to you to modify and distribute this software under the terms of
84 the GNU General Public License and is only of importance to you if
85 you choose to contribute your changes and enhancements to the
86 community by submitting them to Best Practical Solutions, LLC.)
88 By intentionally submitting any modifications, corrections or
89 derivatives to this work, or any other work intended for use with
90 Request Tracker, to Best Practical Solutions, LLC, you confirm that
91 you are the copyright holder for those contributions and you grant
92 Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
93 royalty-free, perpetual, license to use, copy, create derivative
94 works based on those contributions, and sublicense and distribute
95 those contributions and any derivatives thereof.
101 my @MAKE = qw(Makefile);
103 File::Find::find({ no_chdir => 1, wanted => \&tag_pm}, 'lib');
104 File::Find::find({ no_chdir => 1, wanted => \&tag_mason}, 'share/html');
105 File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'sbin');
106 File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'bin');
107 File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'etc/upgrade');
108 File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'devel/tools');
109 tag_makefile ('Makefile.in');
110 tag_makefile ('README');
115 return unless (-f $pm);
116 return if $pm =~ /images/ || $pm =~ /\.(?:png|jpe?g|gif)$/;
117 open( FILE, '<', $pm ) or die "Failed to open $pm";
118 my $file = (join "", <FILE>);
121 return if another_license($pm => $file) && print "has different license\n";
123 my $pmlic = $LICENSE;
124 $pmlic =~ s/^/%# /mg;
125 $pmlic =~ s/\s*$//mg;
126 if ($file =~ /^%# BEGIN BPS TAGGED BLOCK {{{/ms) {
127 print "has license section";
128 $file =~ s/^%# BEGIN BPS TAGGED BLOCK {{{(.*?)%# END BPS TAGGED BLOCK }}}/%# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n%# END BPS TAGGED BLOCK }}}/ms;
132 print "no license section";
133 $file ="%# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n%# END BPS TAGGED BLOCK }}}\n". $file;
135 $file =~ s/%# END BPS TAGGED BLOCK }}}(\n+)/%# END BPS TAGGED BLOCK }}}\n/mg;
141 open( FILE, '>', $pm ) or die "couldn't write new file";
150 open( FILE, '<', $pm ) or die "Failed to open $pm";
151 my $file = (join "", <FILE>);
154 return if another_license($pm => $file) && print "has different license\n";
156 my $pmlic = $LICENSE;
158 $pmlic =~ s/\s*$//mg;
159 if ($file =~ /^# BEGIN BPS TAGGED BLOCK {{{/ms) {
160 print "has license section";
161 $file =~ s/^# BEGIN BPS TAGGED BLOCK {{{(.*?)# END BPS TAGGED BLOCK }}}/# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n# END BPS TAGGED BLOCK }}}/ms;
165 print "no license section";
166 $file ="# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n# END BPS TAGGED BLOCK }}}\n". $file;
168 $file =~ s/# END BPS TAGGED BLOCK }}}(\n+)/# END BPS TAGGED BLOCK }}}\n/mg;
174 open( FILE, '>', $pm ) or die "couldn't write new file";
183 next unless $pm =~ /\.pm/s;
184 open( FILE, '<', $pm ) or die "Failed to open $pm";
185 my $file = (join "", <FILE>);
188 return if another_license($pm => $file) && print "has different license\n";
190 my $pmlic = $LICENSE;
192 $pmlic =~ s/\s*$//mg;
193 if ($file =~ /^# BEGIN BPS TAGGED BLOCK {{{/ms) {
194 print "has license section";
195 $file =~ s/^# BEGIN BPS TAGGED BLOCK {{{(.*?)# END BPS TAGGED BLOCK }}}/# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n# END BPS TAGGED BLOCK }}}/ms;
199 print "no license section";
200 $file ="# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n# END BPS TAGGED BLOCK }}}\n". $file;
202 $file =~ s/# END BPS TAGGED BLOCK }}}(\n+)/# END BPS TAGGED BLOCK }}}\n\n/mg;
208 open( FILE, '>', $pm ) or die "couldn't write new file $pm";
217 return unless (-f $pm);
218 open( FILE, '<', $pm ) or die "Failed to open $pm";
219 my $file = (join "", <FILE>);
222 return if another_license($pm => $file) && print "has different license\n";
224 my $pmlic = $LICENSE;
225 $pmlic =~ s/^/# /msg;
226 $pmlic =~ s/\s*$//mg;
227 if ($file =~ /^# BEGIN BPS TAGGED BLOCK {{{/ms) {
228 print "has license section";
229 $file =~ s/^# BEGIN BPS TAGGED BLOCK {{{(.*?)# END BPS TAGGED BLOCK }}}/# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n# END BPS TAGGED BLOCK }}}/ms;
233 print "no license section";
234 if ($file =~ /^(#!.*?)\n/) {
236 my $lic ="# BEGIN BPS TAGGED BLOCK {{{\n$pmlic\n# END BPS TAGGED BLOCK }}}\n";
237 $file =~ s/^(#!.*?)\n/$1\n$lic/;
241 $file =~ s/# END BPS TAGGED BLOCK }}}(\n+)/# END BPS TAGGED BLOCK }}}\n/mg;
245 open( FILE, '>', $pm ) or die "couldn't write new file";
251 sub another_license {
255 return 1 if ($name =~ /(?:FCKEditor|scriptaculous|superfish|tablesorter|farbtastic)/i);
257 return 0 if $file =~ /Copyright\s+\(c\)\s+\d\d\d\d-\d\d\d\d Best Practical Solutions/i;
258 return 1 if $file =~ /\b(copyright|GPL|Public Domain)\b/i; # common
259 return 1 if $file =~ /\(c\)\s+\d\d\d\d(?:-\d\d\d\d)?/i; # prototype