]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 824640: The product name generated by collectstats.pl is broken
authorFrédéric Buclin <LpSolit@gmail.com>
Wed, 2 Jan 2013 15:01:40 +0000 (16:01 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 2 Jan 2013 15:01:40 +0000 (16:01 +0100)
r=wurblzap a=LpSolit

collectstats.pl

index e1a4603f39b6884069a4e6e0fa61df1c1a43775f..bf0c6869638f5f2cb6179d9b6bfc338da567beab 100755 (executable)
@@ -204,13 +204,14 @@ sub collect_stats {
 
     if (!$exists || scalar(@data)) {
         my $fields = join('|', ('DATE', @statuses, @resolutions));
+        my $product_name = $product->name;
         print DATA <<FIN;
 # Bugzilla Daily Bug Stats
 #
 # Do not edit me! This file is generated.
 #
 # fields: $fields
-# Product: $product->name
+# Product: $product_name
 # Created: $when
 FIN
     }
@@ -308,13 +309,14 @@ sub regenerate_stats {
 
     if (open DATA, ">$file") {
         my $fields = join('|', ('DATE', @statuses, @resolutions));
+        my $product_name = $product->name;
         print DATA <<FIN;
 # Bugzilla Daily Bug Stats
 #
 # Do not edit me! This file is generated.
 #
 # fields: $fields
-# Product: $product->name
+# Product: $product_name
 # Created: $when
 FIN
         # For each day, generate a line of statistics.
@@ -323,7 +325,7 @@ FIN
         for (my $day = $start + 1; $day <= $end; $day++) {
             # Some output feedback
             my $percent_done = ($day - $start - 1) * 100 / $total_days;
-            printf "\rRegenerating %s \[\%.1f\%\%]", $product->name,
+            printf "\rRegenerating %s \[\%.1f\%\%]", $product_name,
                                                      $percent_done;
 
             # Get a list of bugs that were created the previous day, and
@@ -372,7 +374,7 @@ FIN
 
         # Finish up output feedback for this product.
         my $tend = time;
-        say "\rRegenerating " . $product->name . ' [100.0%] - ' .
+        say "\rRegenerating " . $product_name . ' [100.0%] - ' .
             delta_time($tstart, $tend);
 
         close DATA;