summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc25
-rw-r--r--debian/changelog8
2 files changed, 22 insertions, 11 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 4a8f7749d..d83ccf322 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -910,17 +910,20 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
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
diff --git a/debian/changelog b/debian/changelog
index 341555b1e..3e21120cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 ]