diff options
| author | ivan <ivan> | 2009-12-31 13:16:41 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2009-12-31 13:16:41 +0000 |
| commit | 63a268637b2d51a8766412617724b9436439deb6 (patch) | |
| tree | a50f6d4c7829d5c80905e989144317192a44dc90 /rt/sbin/rt-dump-database | |
| parent | 65a561e3cd8c1ba94f6282f5d2a1cd9783afbd21 (diff) | |
| parent | b4b0c7e72d7eaee2fbfc7022022c9698323203dd (diff) | |
This commit was generated by cvs2svn to compensate for changes in r8690,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/sbin/rt-dump-database')
| -rwxr-xr-x | rt/sbin/rt-dump-database | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/rt/sbin/rt-dump-database b/rt/sbin/rt-dump-database index 647781d8d..6175a1043 100755 --- a/rt/sbin/rt-dump-database +++ b/rt/sbin/rt-dump-database @@ -2,8 +2,8 @@ # BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: -# -# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +# +# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC # <jesse@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -48,8 +48,30 @@ # END BPS TAGGED BLOCK }}} use strict; -use lib "/opt/rt3/local/lib"; -use lib "/opt/rt3/lib"; +# fix lib paths, some may be relative +BEGIN { + require File::Spec; + my @libs = ("lib", "local/lib"); + 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; + } + } + $lib = File::Spec->catfile( $bin_path, File::Spec->updir, $lib ); + } + unshift @INC, $lib; + } + +} use RT; use XML::Simple; @@ -117,7 +139,7 @@ foreach my $class (@classes) { # next if $obj-> # skip default names foreach my $field (sort keys %fields) { my $value = $obj->__Value($field); - $rv->{$field} = $value if length($value); + $rv->{$field} = $value if ( defined ($value) && length($value) ); } delete $rv->{Disabled} unless $rv->{Disabled}; |
