summaryrefslogtreecommitdiffstats
path: root/collectstats.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-21 09:44:46 +0200
committerlpsolit%gmail.com <>2006-06-21 09:44:46 +0200
commitc41117346f48774e5c6731303702b5ce98db517b (patch)
tree96cd49de1876e195d8df5760a5519563db41ae24 /collectstats.pl
parente6f88531bd8d4b4d1e36ed078272dac521fcc6e9 (diff)
downloadbugzilla-c41117346f48774e5c6731303702b5ce98db517b.tar.gz
bugzilla-c41117346f48774e5c6731303702b5ce98db517b.tar.xz
Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-xcollectstats.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/collectstats.pl b/collectstats.pl
index ca37c0b3c..2f76e544f 100755
--- a/collectstats.pl
+++ b/collectstats.pl
@@ -34,9 +34,11 @@ use strict;
use IO::Handle;
use lib ".";
-require "globals.pl";
+
use Bugzilla;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
use Bugzilla::Search;
use Bugzilla::User;
use Bugzilla::Product;
@@ -63,6 +65,8 @@ if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") {
$regenerate = 1;
}
+my $datadir = bz_locations()->{'datadir'};
+
my @myproducts = map {$_->name} Bugzilla::Product::get_all_products();
unshift(@myproducts, "-All-");
@@ -71,7 +75,7 @@ foreach (@myproducts) {
my $dir = "$datadir/mining";
&check_data_dir ($dir);
-
+
if ($regenerate) {
&regenerate_stats($dir, $_);
} else {
@@ -206,6 +210,8 @@ sub calculate_dupes {
# Save % count here in a date-named file
# so we can read it back in to do changed counters
# First, delete it if it exists, so we don't add to the contents of an old file
+ my $datadir = bz_locations()->{'datadir'};
+
if (my @files = <$datadir/duplicates/dupes$today*>) {
map { trick_taint($_) } @files;
unlink @files;