r8887 - in /scripts/qa/DebianQA: Archive.pm BTS.pm

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Tue Nov 6 02:04:16 UTC 2007


Author: tincho-guest
Date: Tue Nov  6 02:04:16 2007
New Revision: 8887

URL: http://svn.debian.org/wsvn/?sc=1&rev=8887
Log:
- Resolved a couple of corner cases in BTS.
- Removed using decoded_content for streamed decompression as is way too slow.

Modified:
    scripts/qa/DebianQA/Archive.pm
    scripts/qa/DebianQA/BTS.pm

Modified: scripts/qa/DebianQA/Archive.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/Archive.pm?rev=8887&op=diff
==============================================================================
--- scripts/qa/DebianQA/Archive.pm (original)
+++ scripts/qa/DebianQA/Archive.pm Tue Nov  6 02:04:16 2007
@@ -123,15 +123,10 @@
         }
         # Still reading it all in memory, couldn't find any nice way to
         # interact with gunzip
-        my $gzdata = $res->decoded_content();
-        my $data;
-        if(substr($gzdata, 0, 2) eq "\037\0213") { # gzip magic number
-            #my $z = new IO::Uncompress::Gunzip(\$data);
-            my $uncdata = Compress::Zlib::memGunzip(\$gzdata);
-            $data = IO::Scalar->new(\$uncdata);
-        } else {
-            $data = IO::Scalar->new(\$gzdata);
-        }
+        my $gzdata = $res->content();
+        #my $z = new IO::Uncompress::Gunzip(\$data);
+        my $uncdata = Compress::Zlib::memGunzip(\$gzdata);
+        my $data = IO::Scalar->new(\$uncdata);
 
         # Blank line as "line" separator, so a "line" is a full record
         local $/ = "";

Modified: scripts/qa/DebianQA/BTS.pm
URL: http://svn.debian.org/wsvn/scripts/qa/DebianQA/BTS.pm?rev=8887&op=diff
==============================================================================
--- scripts/qa/DebianQA/BTS.pm (original)
+++ scripts/qa/DebianQA/BTS.pm Tue Nov  6 02:04:16 2007
@@ -43,7 +43,8 @@
             @pkglist = grep( {
                     $CFG{bts}{ttl} * 60 < time - find_stamp($cdata, $_)
                 } @pkglist);
-            info("BTS info for @pkglist is stale");
+            return $cdata unless(@pkglist); # Cache is up-to-date
+            info("BTS info for @pkglist is stale") if(@pkglist);
         }
         info("Downloading list of bugs of (", join(", ", @pkglist),
             ")");
@@ -95,7 +96,8 @@
         $bugs{$pkgname} ||= {};
         my @blist = keys %{ $bugs{$pkgname} };
         # Remove done bugs
-        @blist = grep( { ! $bugs{$pkgname}{$_}{done} } @blist );
+        @blist = grep( { ref $bugs{$pkgname}
+                    and not $bugs{$pkgname}{$_}{done} } @blist );
         $cbugs{$pkgname} = \@blist;
     }
     update_cache("consolidated", \%cbugs, "bts", 1, 0);




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