[Rt-commit] rt branch, 4.2/cmd-boilerplate, created. rt-4.1.13-73-g42c3d95

Alex Vandiver alexmv at bestpractical.com
Tue Jul 2 18:11:28 EDT 2013


The branch, 4.2/cmd-boilerplate has been created
        at  42c3d956976ccb57db35e2eebf453c9d1cb11004 (commit)

- Log -----------------------------------------------------------------
commit 862969e7d5921ee3704b5d54944507a52041cf92
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jul 2 18:10:41 2013 -0400

    Update by running adding boilerplate marker and running devel/tools/cmd-boilerplate

diff --git a/sbin/rt-preferences-viewer.in b/sbin/rt-preferences-viewer.in
index d32588e..af8c5ba 100644
--- a/sbin/rt-preferences-viewer.in
+++ b/sbin/rt-preferences-viewer.in
@@ -50,29 +50,28 @@ use strict;
 use warnings;
 
 # fix lib paths, some may be relative
-BEGIN {
+BEGIN { # BEGIN RT CMD BOILERPLATE
     require File::Spec;
+    require Cwd;
     my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
     my $bin_path;
 
     for my $lib (@libs) {
         unless ( File::Spec->file_name_is_absolute($lib) ) {
-            unless ($bin_path) {
-                if ( File::Spec->file_name_is_absolute(__FILE__) ) {
-                    $bin_path = ( File::Spec->splitpath(__FILE__) )[1];
-                }
-                else {
-                    require FindBin;
-                    no warnings "once";
-                    $bin_path = $FindBin::Bin;
-                }
-            }
+            $bin_path ||= ( File::Spec->splitpath(Cwd::abs_path(__FILE__)) )[1];
             $lib = File::Spec->catfile( $bin_path, File::Spec->updir, $lib );
         }
         unshift @INC, $lib;
     }
+
 }
 
+BEGIN {
+    use RT;
+    RT::LoadConfig();
+    RT::Init();
+};
+
 use Getopt::Long;
 my %opt;
 GetOptions( \%opt, 'help|h', 'user|u=s', 'option|o=s' );
@@ -83,10 +82,6 @@ if ( $opt{help} ) {
     exit;
 }
 
-require RT;
-RT::LoadConfig();
-RT::Init();
-
 require RT::Attributes;
 my $attrs = RT::Attributes->new( RT->SystemUser );
 $attrs->Limit( FIELD => 'Name', VALUE => 'Pref-RT::System-1' );
diff --git a/sbin/rt-validate-aliases.in b/sbin/rt-validate-aliases.in
index 5dbfaa4..12c3647 100644
--- a/sbin/rt-validate-aliases.in
+++ b/sbin/rt-validate-aliases.in
@@ -64,6 +64,7 @@ BEGIN { # BEGIN RT CMD BOILERPLATE
         }
         unshift @INC, $lib;
     }
+
 }
 
 require RT;

commit 42c3d956976ccb57db35e2eebf453c9d1cb11004
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jul 2 18:11:16 2013 -0400

    Remove two BEGIN blocks that were improperly marked with the boilerplate marker
    
    They only survived because of a lack of /g in devel/tools/cmd-boilerplate

diff --git a/sbin/rt-fulltext-indexer.in b/sbin/rt-fulltext-indexer.in
index c3a01ca..32953cc 100644
--- a/sbin/rt-fulltext-indexer.in
+++ b/sbin/rt-fulltext-indexer.in
@@ -67,7 +67,7 @@ BEGIN { # BEGIN RT CMD BOILERPLATE
 
 }
 
-BEGIN { # BEGIN RT CMD BOILERPLATE
+BEGIN {
     use RT;
     RT::LoadConfig();
     RT::Init();
diff --git a/sbin/rt-setup-fulltext-index.in b/sbin/rt-setup-fulltext-index.in
index 0501402..27c0f05 100644
--- a/sbin/rt-setup-fulltext-index.in
+++ b/sbin/rt-setup-fulltext-index.in
@@ -67,7 +67,7 @@ BEGIN { # BEGIN RT CMD BOILERPLATE
 
 }
 
-BEGIN { # BEGIN RT CMD BOILERPLATE
+BEGIN {
     use RT;
     RT::LoadConfig();
     RT::Init();

-----------------------------------------------------------------------


More information about the Rt-commit mailing list