diff options
author | bbaetz%acm.org <> | 2003-11-22 12:50:36 +0100 |
---|---|---|
committer | bbaetz%acm.org <> | 2003-11-22 12:50:36 +0100 |
commit | da857afa089e79ad16fb833dd1ffe397055fd892 (patch) | |
tree | 4582f630aa59c35fdb25aa30fd71c617977e0a86 /contrib | |
parent | 63790559f094b702688365ed12242526ce3ff969 (diff) | |
download | bugzilla-da857afa089e79ad16fb833dd1ffe397055fd892.tar.gz bugzilla-da857afa089e79ad16fb833dd1ffe397055fd892.tar.xz |
Bug 208604 - Make data/template dir locations configurable
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/bug_email.pl | 25 | ||||
-rwxr-xr-x | contrib/bugzilla_email_append.pl | 18 |
2 files changed, 25 insertions, 18 deletions
diff --git a/contrib/bug_email.pl b/contrib/bug_email.pl index a1e537cfe..e26b9a68c 100755 --- a/contrib/bug_email.pl +++ b/contrib/bug_email.pl @@ -37,7 +37,7 @@ # # You need to work with bug_email.pl the MIME::Parser installed. # -# $Id: bug_email.pl,v 1.16 2003/08/22 14:59:13 justdave%syndicomm.com Exp $ +# $Id: bug_email.pl,v 1.17 2003/11/22 03:50:41 bbaetz%acm.org Exp $ ############################################################### # 02/12/2000 (SML) @@ -69,12 +69,15 @@ use strict; use MIME::Parser; -chdir '..'; # this script lives in contrib -push @INC, "contrib/."; -push @INC, "."; +BEGIN { + chdir '..'; # this script lives in contrib + push @INC, "contrib/."; + push @INC, "."; +} require "globals.pl"; -require "BugzillaEmail.pm"; +use BugzillaEmail; +use Bugzilla::Config qw(:DEFAULT $datadir); use lib "."; use lib "../"; @@ -137,8 +140,8 @@ sub storeAttachments( $$ ) print "Error while reading attachment $decoded_file!\n"; next; } - # print "unlinking data/mimedump-tmp/$decoded_file"; - # unlink "data/mimedump-tmp/$decoded_file"; + # print "unlinking $datadir/mimedump-tmp/$decoded_file"; + # unlink "$datadir/mimedump-tmp/$decoded_file"; } else { # data is in the scalar $data = $decoded_file; @@ -248,7 +251,7 @@ sub Reply( $$$$ ) { die "Cannot find sender-email-address" unless defined( $Sender ); if( $test ) { - open( MAIL, ">>data/bug_email_test.log" ); + open( MAIL, '>>', "$datadir/bug_email_test.log" ); } else { open( MAIL, "| /usr/sbin/sendmail -t" ); @@ -697,10 +700,10 @@ my $parser = new MIME::Parser; # Create and set the output directory: # FIXME: There should be a $BUGZILLA_HOME variable (SML) -(-d "data/mimedump-tmp") or mkdir "data/mimedump-tmp",0755 or die "mkdir: $!"; -(-w "data/mimedump-tmp") or die "can't write to directory"; +(-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!"; +(-w "$datadir/mimedump-tmp") or die "can't write to directory"; -$parser->output_dir("data/mimedump-tmp"); +$parser->output_dir("$datadir/mimedump-tmp"); # Read the MIME message: my $entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream"; diff --git a/contrib/bugzilla_email_append.pl b/contrib/bugzilla_email_append.pl index 2ed39c482..da098e66c 100755 --- a/contrib/bugzilla_email_append.pl +++ b/contrib/bugzilla_email_append.pl @@ -31,11 +31,15 @@ use strict; use MIME::Parser; -chdir ".."; # this script lives in contrib, change to main -push @INC, "contrib"; -push @INC, "."; # this script lives in contrib +BEGIN { + chdir ".."; # this script lives in contrib, change to main + push @INC, "contrib"; + push @INC, "."; # this script lives in contrib +} + require "globals.pl"; -require "BugzillaEmail.pm"; +use BugzillaEmail; +use Bugzilla::Config qw(:DEFAULT $datadir); # Create a new MIME parser: my $parser = new MIME::Parser; @@ -44,10 +48,10 @@ my $Comment = ""; # Create and set the output directory: # FIXME: There should be a $BUGZILLA_HOME variable (SML) -(-d "data/mimedump-tmp") or mkdir "data/mimedump-tmp",0755 or die "mkdir: $!"; -(-w "data/mimedump-tmp") or die "can't write to directory"; +(-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!"; +(-w "$datadir/mimedump-tmp") or die "can't write to directory"; -$parser->output_dir("data/mimedump-tmp"); +$parser->output_dir("$datadir/mimedump-tmp"); # Read the MIME message: my $entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream"; |