From c41117346f48774e5c6731303702b5ce98db517b Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 21 Jun 2006 07:44:46 +0000 Subject: Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collectstats.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'collectstats.pl') 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) { ®enerate_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; -- cgit v1.2.3-24-g4f1b