]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Common.pm
* Fix various issues with selecting package and maintainers
[debbugs.git] / Debbugs / Common.pm
index 99c68fdfdfd8b846cb517fd183a8ed1cc6ebfca0..41641e3b13d0936d8c5d9a5a47086e9896409666 100644 (file)
@@ -31,7 +31,7 @@ BEGIN{
 
      @EXPORT = ();
      %EXPORT_TAGS = (util   => [qw(getbugcomponent getbuglocation getlocationpath get_hashname),
-                               qw(appendfile),
+                               qw(appendfile buglog),
                               ],
                     quit   => [qw(quit)],
                     lock   => [qw(filelock unfilelock)],
@@ -137,6 +137,22 @@ sub get_hashname {
     return sprintf "%02d", $_[ 0 ] % 100;
 }
 
+=head2 buglog
+
+     buglog($bugnum);
+
+Returns the path to the logfile corresponding to the bug.
+
+=cut
+
+sub buglog {
+    my $bugnum = shift;
+    my $location = getbuglocation($bugnum, 'log');
+    return getbugcomponent($bugnum, 'log', $location) if ($location);
+    $location = getbuglocation($bugnum, 'log.gz');
+    return getbugcomponent($bugnum, 'log.gz', $location);
+}
+
 
 =head2 appendfile