summaryrefslogtreecommitdiffstats
path: root/collectstats.pl
diff options
context:
space:
mode:
authorjustdave%bugzilla.org <>2008-04-17 06:14:14 +0200
committerjustdave%bugzilla.org <>2008-04-17 06:14:14 +0200
commit32b928bab4ad3715e151bad7aa1609a2dc91266d (patch)
treea1947dbf1968e854fb7e142c804dd05031304426 /collectstats.pl
parente347558dab372645acda0110ca65393bf6b6e73f (diff)
downloadbugzilla-32b928bab4ad3715e151bad7aa1609a2dc91266d.tar.gz
bugzilla-32b928bab4ad3715e151bad7aa1609a2dc91266d.tar.xz
Bug 429379: collectstats.pl fails if ./graphs is a symlink
r=mkanat, a=mkanat
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-xcollectstats.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/collectstats.pl b/collectstats.pl
index 1e5c5fd9d..4515b424c 100755
--- a/collectstats.pl
+++ b/collectstats.pl
@@ -33,6 +33,7 @@
use AnyDBM_File;
use strict;
use IO::Handle;
+use Cwd;
use lib qw(. lib);
@@ -50,10 +51,12 @@ use Bugzilla::Field;
$| = 1;
# Tidy up after graphing module
+my $cwd = Cwd::getcwd();
if (chdir("graphs")) {
unlink <./*.gif>;
unlink <./*.png>;
- chdir("..");
+ # chdir("..") doesn't work if graphs is a symlink, see bug 429378
+ chdir($cwd);
}
# This is a pure command line script.
@@ -61,6 +64,7 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my $dbh = Bugzilla->switch_to_shadow_db();
+
# To recreate the daily statistics, run "collectstats.pl --regenerate" .
my $regenerate = 0;
if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") {