]> git.saurik.com Git - apt.git/commitdiff
cherry pick fix for verification of empty Packages files from the mvo branch
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 31 May 2011 08:51:55 +0000 (10:51 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 31 May 2011 08:51:55 +0000 (10:51 +0200)
apt-pkg/acquire-item.cc
debian/changelog

index 4a8f7749da2a033a74da23f4ae65f92e383ca98a..d83ccf322a5bc858a4a0673a679d9cf15a4b25c1 100644 (file)
@@ -910,17 +910,20 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
         pkgTagSection sec;
         pkgTagFile tag(&fd);
 
         pkgTagSection sec;
         pkgTagFile tag(&fd);
 
-        if (_error->PendingError() || !tag.Step(sec)) {
-           Status = StatError;
-           _error->DumpErrors();
-           Rename(DestFile,DestFile + ".FAILED");
-           return;
-        } else if (!sec.Exists("Package")) {
-           Status = StatError;
-           ErrorText = ("Encountered a section with no Package: header");
-           Rename(DestFile,DestFile + ".FAILED");
-           return;
-        }
+         // Only test for correctness if the file is not empty (empty is ok)
+         if (fd.Size() > 0) {
+            if (_error->PendingError() || !tag.Step(sec)) {
+               Status = StatError;
+               _error->DumpErrors();
+               Rename(DestFile,DestFile + ".FAILED");
+               return;
+            } else if (!sec.Exists("Package")) {
+               Status = StatError;
+               ErrorText = ("Encountered a section with no Package: header");
+               Rename(DestFile,DestFile + ".FAILED");
+               return;
+            }
+         }
       }
        
       // Done, move it into position
       }
        
       // Done, move it into position
index 341555b1e39b4a182357c3b148c8c02e8a2919e4..3e21120cf8038d3125c8c94592dbff2d047f41c1 100644 (file)
@@ -1,3 +1,11 @@
+apt (0.8.14.1ubuntu5) oneiric; urgency=low
+
+  * apt-pkg/acquire-item.cc:
+    - do not reject empty Packages files when checking them for
+      correctness
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 31 May 2011 10:41:30 +0200
+
 apt (0.8.14.1ubuntu4) oneiric; urgency=low
 
   [ Julian Andres Klode ]
 apt (0.8.14.1ubuntu4) oneiric; urgency=low
 
   [ Julian Andres Klode ]