diff options
author | mkanat%bugzilla.org <> | 2007-10-19 11:46:10 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2007-10-19 11:46:10 +0000 |
commit | 415e32d463bbb881d991d886ddba6f859669c098 (patch) | |
tree | fd97f6e5bd6f2333f9c9dceda58f5ba226d3bc4a /importxml.pl | |
parent | Bug 398990: process_bug.cgi shouldn't check the 'reporter' field as this fiel... (diff) | |
download | bugzilla-415e32d463bbb881d991d886ddba6f859669c098.tar.gz bugzilla-415e32d463bbb881d991d886ddba6f859669c098.tar.bz2 bugzilla-415e32d463bbb881d991d886ddba6f859669c098.zip |
Bug 399954: Make Bugzilla able to hold its dependencies in a local directory
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'importxml.pl')
-rwxr-xr-x | importxml.pl | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/importxml.pl b/importxml.pl index 9ef8150f6..80506971c 100755 --- a/importxml.pl +++ b/importxml.pl @@ -54,22 +54,16 @@ use strict; # ##################################################################### -# figure out which path this script lives in. Set the current path to -# this and add it to @INC so this will work when run as part of mail -# alias by the mailer daemon -# since "use lib" is run at compile time, we need to enclose the -# $::path declaration in a BEGIN block so that it is executed before -# the rest of the file is compiled. +use File::Basename qw(dirname); +# MTAs may call this script from any directory, but it should always +# run from this one so that it can find its modules. BEGIN { - $::path = $0; - $::path =~ m#(.*)/[^/]+#; - $::path = $1; - $::path ||= '.'; # $0 is empty at compile time. This line will - # have no effect on this script at runtime. + require File::Basename; + my $dir = $0; $dir =~ /(.*)/; $dir = $1; # trick taint + chdir(File::Basename::dirname($dir)); } -chdir $::path; -use lib ($::path); +use lib qw(. lib); # Data dumber is used for debugging, I got tired of copying it back in # and then removing it. #use Data::Dumper; |