From da857afa089e79ad16fb833dd1ffe397055fd892 Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Sat, 22 Nov 2003 11:50:36 +0000 Subject: Bug 208604 - Make data/template dir locations configurable --- contrib/bugzilla_email_append.pl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'contrib/bugzilla_email_append.pl') 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"; -- cgit v1.2.3-24-g4f1b