From 7959e0c5a2b2367c97ce5e90de8df8e0d3794406 Mon Sep 17 00:00:00 2001 From: "endico%mozilla.org" Date: Fri, 23 Jun 2000 22:43:21 +0000 Subject: [PATCH] find the path this script lives in and add it to @INC and to the current working directory. git-svn-id: svn://10.0.0.236/trunk@73103 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/importxml.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/importxml.pl b/mozilla/webtools/bugzilla/importxml.pl index 92c9a926959..eeef3370818 100755 --- a/mozilla/webtools/bugzilla/importxml.pl +++ b/mozilla/webtools/bugzilla/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;