4 # {{{ BEGIN BPS TAGGED BLOCK
8 # This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
9 # <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA.
31 # CONTRIBUTION SUBMISSION POLICY:
33 # (The following paragraph is not intended to limit the rights granted
34 # to you to modify and distribute this software under the terms of
35 # the GNU General Public License and is only of importance to you if
36 # you choose to contribute your changes and enhancements to the
37 # community by submitting them to Best Practical Solutions, LLC.)
39 # By intentionally submitting any modifications, corrections or
40 # derivatives to this work, or any other work intended for use with
41 # Request Tracker, to Best Practical Solutions, LLC, you confirm that
42 # you are the copyright holder for those contributions and you grant
43 # Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
44 # royalty-free, perpetual, license to use, copy, create derivative
45 # works based on those contributions, and sublicense and distribute
46 # those contributions and any derivatives thereof.
48 # }}} END BPS TAGGED BLOCK
49 my $LICENSE = <<'EOL';
53 This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
54 <jesse@bestpractical.com>
56 (Except where explicitly superseded by other copyright notices)
61 This work is made available to you under the terms of Version 2 of
62 the GNU General Public License. A copy of that license should have
63 been provided with this software, but in any event can be snarfed
66 This work is distributed in the hope that it will be useful, but
67 WITHOUT ANY WARRANTY; without even the implied warranty of
68 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
69 General Public License for more details.
71 You should have received a copy of the GNU General Public License
72 along with this program; if not, write to the Free Software
73 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
76 CONTRIBUTION SUBMISSION POLICY:
78 (The following paragraph is not intended to limit the rights granted
79 to you to modify and distribute this software under the terms of
80 the GNU General Public License and is only of importance to you if
81 you choose to contribute your changes and enhancements to the
82 community by submitting them to Best Practical Solutions, LLC.)
84 By intentionally submitting any modifications, corrections or
85 derivatives to this work, or any other work intended for use with
86 Request Tracker, to Best Practical Solutions, LLC, you confirm that
87 you are the copyright holder for those contributions and you grant
88 Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
89 royalty-free, perpetual, license to use, copy, create derivative
90 works based on those contributions, and sublicense and distribute
91 those contributions and any derivatives thereof.
97 my @MAKE = qw(Makefile);
99 File::Find::find({ no_chdir => 1, wanted => \&tag_pm}, 'lib');
100 File::Find::find({ no_chdir => 1, wanted => \&tag_mason}, 'html');
101 File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'sbin');
102 File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'bin');
103 tag_makefile ('Makefile.in');
104 tag_makefile ('README');
109 next unless (-f $pm);
110 next if ($pm =~ /images/);
111 open(FILE,"<$pm") || die "Failed to open $pm";
112 my $file = (join "", <FILE>);
114 my $pmlic = $LICENSE;
115 $pmlic =~ s/^/%# /mg;
119 if ($file =~ /^%# {{{ BEGIN BPS TAGGED BLOCK/ms) {
120 print "has license section";
121 $file =~ s/^%# {{{ BEGIN BPS TAGGED BLOCK(.*?)%# }}} END BPS TAGGED BLOCK/%# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic%# }}} END BPS TAGGED BLOCK/ms;
125 print "no license section";
126 $file ="%# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic%# }}} END BPS TAGGED BLOCK\n". $file;
128 $file =~ s/%# }}} END BPS TAGGED BLOCK(\n+)/%# }}} END BPS TAGGED BLOCK\n/mg;
134 open (FILE, ">$pm") || die "couldn't write new file";
143 open(FILE,"<$pm") || die "Failed to open $pm";
144 my $file = (join "", <FILE>);
146 my $pmlic = $LICENSE;
151 if ($file =~ /^# {{{ BEGIN BPS TAGGED BLOCK/ms) {
152 print "has license section";
153 $file =~ s/^# {{{ BEGIN BPS TAGGED BLOCK(.*?)# }}} END BPS TAGGED BLOCK/# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic# }}} END BPS TAGGED BLOCK/ms;
157 print "no license section";
158 $file ="# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic# }}} END BPS TAGGED BLOCK\n". $file;
160 $file =~ s/# }}} END BPS TAGGED BLOCK(\n+)/# }}} END BPS TAGGED BLOCK\n/mg;
166 open (FILE, ">$pm") || die "couldn't write new file";
175 next unless $pm =~ /\.pm/s;
176 open(FILE,"<$pm") || die "Failed to open $pm";
177 my $file = (join "", <FILE>);
179 my $pmlic = $LICENSE;
184 if ($file =~ /^# {{{ BEGIN BPS TAGGED BLOCK/ms) {
185 print "has license section";
186 $file =~ s/^# {{{ BEGIN BPS TAGGED BLOCK(.*?)# }}} END BPS TAGGED BLOCK/# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic# }}} END BPS TAGGED BLOCK/ms;
190 print "no license section";
191 $file ="# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic# }}} END BPS TAGGED BLOCK\n". $file;
193 $file =~ s/# }}} END BPS TAGGED BLOCK(\n+)/# }}} END BPS TAGGED BLOCK\n/mg;
199 open (FILE, ">$pm") || die "couldn't write new file $pm";
208 return unless (-f $pm);
209 open(FILE,"<$pm") || die "Failed to open $pm";
210 my $file = (join "", <FILE>);
212 my $pmlic = $LICENSE;
213 $pmlic =~ s/^/# /msg;
216 if ($file =~ /^# {{{ BEGIN BPS TAGGED BLOCK/ms) {
217 print "has license section";
218 $file =~ s/^# {{{ BEGIN BPS TAGGED BLOCK(.*?)# }}} END BPS TAGGED BLOCK/# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic# }}} END BPS TAGGED BLOCK/ms;
222 print "no license section";
223 if ($file =~ /^(#!.*?)\n/) {
225 my $lic ="# {{{ BEGIN BPS TAGGED BLOCK\n$pmlic# }}} END BPS TAGGED BLOCK\n";
226 $file =~ s/^(#!.*?)\n/$1\n$lic/;
230 $file =~ s/# }}} END BPS TAGGED BLOCK(\n+)/# }}} END BPS TAGGED BLOCK\n/mg;
234 open (FILE, ">$pm") || die "couldn't write new file";