Package: debmirror
Version: 20070123
Severity: important
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu hardy ubuntu-patch

libcompress-zlib-perl gzreadline seems to ignore the $/ setting now.
Attached patch fixes this and cleans up parsing loops.

Thanks!

-- 
Kees Cook                                            @outflux.net
--- debmirror	2007-11-12 14:10:50.000000000 -0800
+++ /usr/bin/debmirror	2007-11-12 13:46:07.000000000 -0800
@@ -791,7 +790,6 @@
 
 say("Parse Packages and Sources files and add to the file list everything therein.");
 {
-  local $/="\n\n";
   my ($filename, $size, $md5sum, $directory, $exclude, $include,
       $architecture, $exclude_deb_section, $limit_priority, $deb_section,
       $deb_priority);
@@ -812,13 +810,14 @@
     my $loop = 1;
     while ($loop) {
       my $buf = "";
-      while(($res = $gunzf->gzreadline($line) > 0)
+      while((($res = $gunzf->gzreadline($line)) > 0)
 	    && !($line =~ /^$/)) {
 	$buf = $buf . $line;
       }
-      if ($res <= 0) {
+      die "$file: $!" if ($res < 0);
+      if ($res == 0) {
 	$loop = 0;
-	next;
+	next if ($buf eq "");
       }
       $_ = $buf;
       ($filename)=m/^Filename:\s+(.*)/im;
@@ -855,13 +854,14 @@
     my $loop = 1;
     while ($loop) {
       my $buf = "";
-      while(($res = $gunzf->gzreadline($line) > 0)
+      while((($res = $gunzf->gzreadline($line)) > 0)
 	    && !($line =~ /^$/)) {
 	$buf = $buf . $line;
       }
-      if ($res <= 0) {
+      die "$file: $!" if ($res < 0);
+      if ($res == 0) {
 	$loop = 0;
-	next;
+	next if ($buf eq "");
       }
       $_ = $buf;
       ($directory) = m/^Directory:\s+(.*)/im;

Reply via email to