Commit 32b928ba authored by justdave%bugzilla.org's avatar justdave%bugzilla.org

Bug 429379: collectstats.pl fails if ./graphs is a symlink

r=mkanat, a=mkanat
parent e347558d
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
use AnyDBM_File; use AnyDBM_File;
use strict; use strict;
use IO::Handle; use IO::Handle;
use Cwd;
use lib qw(. lib); use lib qw(. lib);
...@@ -50,10 +51,12 @@ use Bugzilla::Field; ...@@ -50,10 +51,12 @@ use Bugzilla::Field;
$| = 1; $| = 1;
# Tidy up after graphing module # Tidy up after graphing module
my $cwd = Cwd::getcwd();
if (chdir("graphs")) { if (chdir("graphs")) {
unlink <./*.gif>; unlink <./*.gif>;
unlink <./*.png>; unlink <./*.png>;
chdir(".."); # chdir("..") doesn't work if graphs is a symlink, see bug 429378
chdir($cwd);
} }
# This is a pure command line script. # This is a pure command line script.
...@@ -61,6 +64,7 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE); ...@@ -61,6 +64,7 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my $dbh = Bugzilla->switch_to_shadow_db(); my $dbh = Bugzilla->switch_to_shadow_db();
# To recreate the daily statistics, run "collectstats.pl --regenerate" . # To recreate the daily statistics, run "collectstats.pl --regenerate" .
my $regenerate = 0; my $regenerate = 0;
if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") { if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") {
......
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