[Rt-commit] r11972 - in rt/branches/3.8-TESTING: bin
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Apr 29 23:34:43 EDT 2008
Author: sunnavy
Date: Tue Apr 29 23:34:42 2008
New Revision: 11972
Modified:
rt/branches/3.8-TESTING/bin/rt-crontool.in
rt/branches/3.8-TESTING/bin/standalone_httpd.in
rt/branches/3.8-TESTING/sbin/rt-clean-sessions.in
rt/branches/3.8-TESTING/sbin/rt-dump-database.in
rt/branches/3.8-TESTING/sbin/rt-notify-group-admin.in
rt/branches/3.8-TESTING/sbin/rt-setup-database.in
rt/branches/3.8-TESTING/sbin/rt-shredder.in
rt/branches/3.8-TESTING/sbin/rt-validator.in
Log:
convert relative @.._LIB_PATH@ to be absolute by FindBin
Modified: rt/branches/3.8-TESTING/bin/rt-crontool.in
==============================================================================
--- rt/branches/3.8-TESTING/bin/rt-crontool.in (original)
+++ rt/branches/3.8-TESTING/bin/rt-crontool.in Tue Apr 29 23:34:42 2008
@@ -49,7 +49,20 @@
use strict;
use Carp;
-use lib ("@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
package RT;
Modified: rt/branches/3.8-TESTING/bin/standalone_httpd.in
==============================================================================
--- rt/branches/3.8-TESTING/bin/standalone_httpd.in (original)
+++ rt/branches/3.8-TESTING/bin/standalone_httpd.in Tue Apr 29 23:34:42 2008
@@ -49,7 +49,21 @@
use warnings;
use strict;
-use lib( "@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
+
use RT;
RT::LoadConfig();
RT->InitLogging();
Modified: rt/branches/3.8-TESTING/sbin/rt-clean-sessions.in
==============================================================================
--- rt/branches/3.8-TESTING/sbin/rt-clean-sessions.in (original)
+++ rt/branches/3.8-TESTING/sbin/rt-clean-sessions.in Tue Apr 29 23:34:42 2008
@@ -48,7 +48,21 @@
# END BPS TAGGED BLOCK }}}
use strict;
use warnings;
-use lib ("@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
+
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
use Getopt::Long;
my %opt;
Modified: rt/branches/3.8-TESTING/sbin/rt-dump-database.in
==============================================================================
--- rt/branches/3.8-TESTING/sbin/rt-dump-database.in (original)
+++ rt/branches/3.8-TESTING/sbin/rt-dump-database.in Tue Apr 29 23:34:42 2008
@@ -48,8 +48,20 @@
# END BPS TAGGED BLOCK }}}
use strict;
-use lib "@LOCAL_LIB_PATH@";
-use lib "@RT_LIB_PATH@";
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
use RT;
use XML::Simple;
Modified: rt/branches/3.8-TESTING/sbin/rt-notify-group-admin.in
==============================================================================
--- rt/branches/3.8-TESTING/sbin/rt-notify-group-admin.in (original)
+++ rt/branches/3.8-TESTING/sbin/rt-notify-group-admin.in Tue Apr 29 23:34:42 2008
@@ -86,8 +86,20 @@
use warnings;
use strict;
-use lib "@LOCAL_LIB_PATH@";
-use lib "@RT_LIB_PATH@";
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
use RT;
RT::LoadConfig;
Modified: rt/branches/3.8-TESTING/sbin/rt-setup-database.in
==============================================================================
--- rt/branches/3.8-TESTING/sbin/rt-setup-database.in (original)
+++ rt/branches/3.8-TESTING/sbin/rt-setup-database.in Tue Apr 29 23:34:42 2008
@@ -51,8 +51,20 @@
use vars qw($Nobody $SystemUser $item);
-use lib "@LOCAL_LIB_PATH@";
-use lib "@RT_LIB_PATH@";
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
#This drags in RT's config.pm
# We do it in a begin block because RT::Handle needs to know the type to do its
Modified: rt/branches/3.8-TESTING/sbin/rt-shredder.in
==============================================================================
--- rt/branches/3.8-TESTING/sbin/rt-shredder.in (original)
+++ rt/branches/3.8-TESTING/sbin/rt-shredder.in Tue Apr 29 23:34:42 2008
@@ -110,7 +110,20 @@
use strict;
use warnings FATAL => 'all';
-use lib ("@LOCAL_LIB_PATH@", "@RT_LIB_PATH@");
+# fix lib paths, some may be relative
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
use RT::Shredder ();
use Getopt::Long qw(GetOptions);
Modified: rt/branches/3.8-TESTING/sbin/rt-validator.in
==============================================================================
--- rt/branches/3.8-TESTING/sbin/rt-validator.in (original)
+++ rt/branches/3.8-TESTING/sbin/rt-validator.in Tue Apr 29 23:34:42 2008
@@ -73,8 +73,19 @@
use strict;
use Getopt::Long;
-### after: use lib qw(@RT_LIB_PATH@);
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
+BEGIN {
+ require File::Spec;
+ my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
+ for my $lib (@libs) {
+ unless ( File::Spec->file_name_is_absolute($lib) ) {
+ require FindBin;
+ $lib =
+ File::Spec->catfile( $FindBin::Bin, File::Spec->updir, $lib );
+ }
+ unshift @INC, $lib;
+ }
+
+}
use RT::Shredder;
use RT::Shredder::Constants;
More information about the Rt-commit
mailing list