Commit d9c182c4 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 280193: Round up places using data/ instead of $datadir - Patch by Marc…

Bug 280193: Round up places using data/ instead of $datadir - Patch by Marc Schumann <wurblzap@gmail.com> r=LpSolit, a=justdave
parent e52d541e
...@@ -26,7 +26,7 @@ use base qw(Exporter); ...@@ -26,7 +26,7 @@ use base qw(Exporter);
@Bugzilla::Error::EXPORT = qw(ThrowCodeError ThrowTemplateError ThrowUserError); @Bugzilla::Error::EXPORT = qw(ThrowCodeError ThrowTemplateError ThrowUserError);
use Bugzilla::Config; use Bugzilla::Config qw($datadir);
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util; use Bugzilla::Util;
use Date::Format; use Date::Format;
...@@ -42,8 +42,8 @@ sub _throw_error { ...@@ -42,8 +42,8 @@ sub _throw_error {
# and the transaction is rolled back (if supported) # and the transaction is rolled back (if supported)
Bugzilla->dbh->bz_unlock_tables(UNLOCK_ABORT); Bugzilla->dbh->bz_unlock_tables(UNLOCK_ABORT);
# If a writable data/errorlog exists, log error details there. # If a writable $datadir/errorlog exists, log error details there.
if (-w "data/errorlog") { if (-w "$datadir/errorlog") {
require Data::Dumper; require Data::Dumper;
my $mesg = ""; my $mesg = "";
for (1..75) { $mesg .= "-"; }; for (1..75) { $mesg .= "-"; };
...@@ -67,7 +67,7 @@ sub _throw_error { ...@@ -67,7 +67,7 @@ sub _throw_error {
$val = "*****" if $val =~ /password|http_pass/i; $val = "*****" if $val =~ /password|http_pass/i;
$mesg .= "[$$] " . Data::Dumper->Dump([$val],["env($var)"]); $mesg .= "[$$] " . Data::Dumper->Dump([$val],["env($var)"]);
} }
open(ERRORLOGFID, ">>data/errorlog"); open(ERRORLOGFID, ">>$datadir/errorlog");
print ERRORLOGFID "$mesg\n"; print ERRORLOGFID "$mesg\n";
close ERRORLOGFID; close ERRORLOGFID;
} }
......
...@@ -27,7 +27,7 @@ use Bugzilla; ...@@ -27,7 +27,7 @@ use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Config; use Bugzilla::Config qw($datadir);
require "globals.pl"; require "globals.pl";
...@@ -166,7 +166,7 @@ if ($action eq 'new') { ...@@ -166,7 +166,7 @@ if ($action eq 'new') {
$sth->execute($classification,$description); $sth->execute($classification,$description);
# Make versioncache flush # Make versioncache flush
unlink "data/versioncache"; unlink "$datadir/versioncache";
LoadTemplate($action); LoadTemplate($action);
} }
...@@ -230,7 +230,7 @@ if ($action eq 'delete') { ...@@ -230,7 +230,7 @@ if ($action eq 'delete') {
$dbh->bz_unlock_tables(); $dbh->bz_unlock_tables();
unlink "data/versioncache"; unlink "$datadir/versioncache";
LoadTemplate($action); LoadTemplate($action);
} }
...@@ -320,7 +320,7 @@ if ($action eq 'update') { ...@@ -320,7 +320,7 @@ if ($action eq 'update') {
$dbh->bz_unlock_tables(); $dbh->bz_unlock_tables();
unlink "data/versioncache"; unlink "$datadir/versioncache";
LoadTemplate($action); LoadTemplate($action);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
# issues as possible. # issues as possible.
use Socket; use Socket;
use Bugzilla::Config qw($datadir);
my $envpath = $ENV{'PATH'}; my $envpath = $ENV{'PATH'};
use lib "."; use lib ".";
use strict; use strict;
...@@ -165,8 +166,8 @@ if ($@ eq '') { ...@@ -165,8 +166,8 @@ if ($@ eq '') {
$image->fill(50, 50, $red); $image->fill(50, 50, $red);
if ($image->can('png')) { if ($image->can('png')) {
create_file('data/testgd-local.png', $image->png); create_file("$datadir/testgd-local.png", $image->png);
check_image('data/testgd-local.png', 't/testgd.png', 'GD', 'PNG'); check_image("$datadir/testgd-local.png", 't/testgd.png', 'GD', 'PNG');
} else { } else {
die "GD doesn't support PNG generation\n"; die "GD doesn't support PNG generation\n";
} }
...@@ -188,8 +189,8 @@ if ($@ eq '') { ...@@ -188,8 +189,8 @@ if ($@ eq '') {
$chart->add_pt('bar', 16, 32); $chart->add_pt('bar', 16, 32);
my $type = $chart->can('gif') ? 'gif' : 'png'; my $type = $chart->can('gif') ? 'gif' : 'png';
$chart->$type("data/testchart-local.$type"); $chart->$type("$datadir/testchart-local.$type");
check_image("data/testchart-local.$type", "t/testchart.$type", check_image("$datadir/testchart-local.$type", "t/testchart.$type",
"Chart", uc($type)); "Chart", uc($type));
}; };
if ($@ ne '') { if ($@ ne '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment