diff options
author | endico%mozilla.org <> | 2000-06-24 07:43:21 +0200 |
---|---|---|
committer | endico%mozilla.org <> | 2000-06-24 07:43:21 +0200 |
commit | 1765489b37d12916f68fe6c1cd14b8cdc693e581 (patch) | |
tree | 0eac8f8725f7cf65f8da987cfe96387b19ea5a03 | |
parent | 8f81be2bbf1db927fbe8ce0273ed31b76d9f763a (diff) | |
download | bugzilla-1765489b37d12916f68fe6c1cd14b8cdc693e581.tar.gz bugzilla-1765489b37d12916f68fe6c1cd14b8cdc693e581.tar.xz |
find the path this script lives in and add it to @INC and to the current working directory.
-rwxr-xr-x | importxml.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/importxml.pl b/importxml.pl index 92c9a9269..eeef33708 100755 --- a/importxml.pl +++ b/importxml.pl @@ -35,9 +35,18 @@ require "CGI.pl"; require "globals.pl"; $::lockcount = 0; +# 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 +my $path = $0; +$path =~ s#(.*)/[^/]+#$1#; +chdir $path; +use lib ($path); + GetVersionTable(); ConnectToDatabase(); + sub sillyness { my $zz; $zz = %::components; @@ -182,7 +191,7 @@ if (defined $tree->[1][0]->{'urlbase'}) { my $bugqty = ($#{@{$tree}->[1]} +1 -3) / 4; -my $log = "Importing $bugqty bug(s) from $urlbase,\n sent by $exporter.\n"; +my $log = "Imported $bugqty bug(s) from $urlbase,\n sent by $exporter.\n"; for (my $k=1 ; $k <= $bugqty ; $k++) { my $cur = $k*4; |