From: Don Armstrong Date: Fri, 1 Dec 2006 06:29:39 +0000 (-0800) Subject: add buglog to Debbugs::Common X-Git-Tag: release/2.6.0~585^2^2~59 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0c4ff9e5a8fde037046bc1e905312a3d9116a461;p=debbugs.git add buglog to Debbugs::Common --- diff --git a/Debbugs/Common.pm b/Debbugs/Common.pm index 99c68fdf..41641e3b 100644 --- a/Debbugs/Common.pm +++ b/Debbugs/Common.pm @@ -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