[Bps-public-commit] r17412 - RT-Extension-rt_cpan_org/html/Public

ruz at bestpractical.com ruz at bestpractical.com
Mon Dec 29 18:45:42 EST 2008


Author: ruz
Date: Mon Dec 29 18:45:42 2008
New Revision: 17412

Modified:
   RT-Extension-rt_cpan_org/html/Public/bugs-per-dist.tsv

Log:
* use proper 'inherit' flag instead of abort
* search for file in comp roots instead of hard-coded path

Modified: RT-Extension-rt_cpan_org/html/Public/bugs-per-dist.tsv
==============================================================================
--- RT-Extension-rt_cpan_org/html/Public/bugs-per-dist.tsv	(original)
+++ RT-Extension-rt_cpan_org/html/Public/bugs-per-dist.tsv	Mon Dec 29 18:45:42 2008
@@ -45,15 +45,28 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
+<%flags>
+inherit => undef
+</%flags>
 <%init>
 $r->content_type("text/plain");
 
-my $fh;
-if ( open $fh, "<", "/opt/rt/rt.cpan.org-managed/local/html/Public/bugs-per-dist.data" ) {
+my $fname = '';
+foreach my $test ( map "$_/Public/bugs-per-dist.data", $self->interp->comp_root_array ) {
+    next unless -f $test;
+
+    $fname = $test;
+    last;
+}
+
+unless ( $fname ) {
+    print "# Couldn't find data file";
+    return;
+}
+
+if ( open my $fh, "<", $fname ) {
     print while <$fh>;
 } else {
     print "# Error reading data file: $!\n";
 }
-
-$m->abort;
 </%init>



More information about the Bps-public-commit mailing list