4 # BEGIN BPS TAGGED BLOCK {{{
8 # This software is Copyright (c) 1996-2016 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 }}}
55 File::Find::find({ no_chdir => 1, wanted => \&tag_it}, 'sbin', 'bin');
59 return unless (-f $file);
60 return if $file !~ /.in$/;
61 open( FILE, '<', $file ) or die "Failed to open $file";
62 my $content = (join "", <FILE>);
64 my $new = q'BEGIN { # BEGIN RT CMD BOILERPLATE
67 my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
71 unless ( File::Spec->file_name_is_absolute($lib) ) {
72 $bin_path ||= ( File::Spec->splitpath(Cwd::abs_path(__FILE__)) )[1];
73 $lib = File::Spec->catfile( $bin_path, File::Spec->updir, $lib );
79 unless ($content =~ s/^BEGIN \{ # BEGIN RT CMD BOILERPLATE.*?^\}$/$new/ms) {
85 open( FILE, '>', $file ) or die "couldn't write new file";