r9263 - /scripts/qa/qareport-chlog.cgi

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Tue Nov 13 12:48:57 UTC 2007


Author: dmn
Date: Tue Nov 13 12:48:57 2007
New Revision: 9263

URL: http://svn.debian.org/wsvn/?sc=1&rev=9263
Log:
Use cached Svn information

Modified:
    scripts/qa/qareport-chlog.cgi

Modified: scripts/qa/qareport-chlog.cgi
URL: http://svn.debian.org/wsvn/scripts/qa/qareport-chlog.cgi?rev=9263&op=diff
==============================================================================
--- scripts/qa/qareport-chlog.cgi (original)
+++ scripts/qa/qareport-chlog.cgi Tue Nov 13 12:48:57 2007
@@ -11,7 +11,7 @@
 use warnings;
 
 use DebianQA::Config qw(read_config %CFG);
-use DebianQA::Svn qw(get_svn_file);
+use DebianQA::Svn;
 use CGI ':fatalsToBrowser';
 use CGI;
 
@@ -37,71 +37,9 @@
 my $pkg = $cgi->param('pkg');
 my $rel = $cgi->param('rel');
 
-my $svnpath = $CFG{svn}{repository};
+my $svn = svn_get();
 
-# Sanitise, as SVN::Client is too stupid
-$svnpath =~ s{/+$}{};
-$svnpath .= "/";
-$svnpath .= $CFG{svn}{packages_path} if($CFG{svn}{packages_path});
-$svnpath =~ s{/+$}{};
-my $svnpostpath = $CFG{svn}{post_path} || "";
-# Always has a slash if not empty
-$svnpostpath =~ s{^/*(.*?)/*$}{/$1} if($svnpostpath);
-
-my $pkg_home = "$svnpath/$pkg$svnpostpath";
-my $svn = SVN::Client->new();
-my $chlog = get_svn_file($svn, "$pkg_home/debian/changelog");
-my $parser = Parse::DebianChangelog->init({instring=>$chlog});
-my $error = $parser->get_error() or $parser->get_parse_errors();
-my $text;
-if( $error )
-{
-    $text = "ERROR:\n$error";
-}
-else
-{
-    my($lastchl, $unfinishedchl);
-    foreach($parser->data()) {
-        if($_->Distribution =~ /^(?:unstable|experimental)$/) {
-            $lastchl = $_;
-            last;
-        }
-        if(! $unfinishedchl and $_->Distribution eq "UNRELEASED") {
-            $unfinishedchl = $_;
-        }
-    }
-
-    my $entry;
-    if( $rel eq 'rel' )
-    {
-        if( $lastchl )
-        {
-            $entry = $lastchl;
-        }
-        else
-        {
-            $text = "Unable to find released changelog for package '$pkg'";
-        }
-    }
-    else
-    {
-        if( $unfinishedchl )
-        {
-            $entry = $unfinishedchl;
-        }
-        else
-        {
-            $text = "Unable to find unreleased changelog for package '$pkg'";
-        }
-    }
-
-    $text = join(
-        "\n",
-        $entry->Header,
-        $entry->Changes,
-        $entry->Trailer,
-    ) if $entry;
-}
+my $text = $svn->{$pkg}{ ($rel eq 'rel')?'text' : 'un_text' };
 
 $text =~ s/&/&/g;
 $text =~ s/'/"/g;




More information about the Pkg-perl-cvs-commits mailing list