]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Examine the age of all merged bugs logs and use in calculation to
authorDon Armstrong <don@donarmstrong.com>
Wed, 4 Jul 2007 17:36:22 +0000 (10:36 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 4 Jul 2007 17:36:22 +0000 (10:36 -0700)
   avoid starting the archive process on unarchiveable bugs.

Debbugs/Status.pm

index ce58e9903d3ca2988d124bc365c7a834f9427acd..8349036ea56fa38f8c36d1eac8a74f88cd418e7e 100644 (file)
@@ -629,11 +629,17 @@ sub bug_archiveable{
      # checking the versioning information if the bug has been -done for less than 28 days.
      my $log_file = getbugcomponent($param{bug},'log');
      if (not defined $log_file) {
-         print STDERR "Cannot archive $param{bug} because the log doesn't exists\n" if $DEBUG;
+         print STDERR "Cannot archive $param{bug} because the log doesn't exist\n" if $DEBUG;
+         return $cannot_archive;
      }
+     my $max_log_age = max(map {$config{remove_age} - -M $_}
+                          $log_file, map {my $log = getbugcomponent($_,'log');
+                                          defined $log ? ($log) : ();
+                                     }
+                          split / /, $status->{mergedwith}
+                      );
      if (not $param{days_until} and not $param{ignore_time}
-        and $config{remove_age} >
-        -M $log_file
+        and $max_log_age > 0
        ) {
          print STDERR "Cannot archive $param{bug} because of time\n" if $DEBUG;
          return $cannot_archive;
@@ -711,10 +717,7 @@ sub bug_archiveable{
          return $param{days_until}?0:1;
      }
      # 6. at least 28 days have passed since the last action has occured or the bug was closed
-     my $age = ceil(max(map {$config{remove_age} - -M $log_file}
-                       $param{bug}, split / /, $status->{mergedwith}
-                      )
-                  );
+     my $age = ceil($max_log_age);
      if ($age > 0 or $min_archive_days > 0) {
          return $param{days_until}?max($age,$min_archive_days):0;
      }
@@ -1113,7 +1116,7 @@ sub buggy {
                    # We only want to warn if it's a package which actually has a maintainer
                    my $maints = getmaintainers();
                    next if not exists $maints->{$source};
-                   warn "Unable to open $config{version_packages_dir}/$srchash/$source: $!";
+                   warn "Bug $param{bug}: unable to open $config{version_packages_dir}/$srchash/$source: $!";
                    next;
               }
               $version->load($version_fh);