Fix assert failure on missing repomd release/index files.
authorPanu Matilainen <pmatilai@turre.koti.laiskiainen.org>
Sun, 8 Jul 2007 18:09:32 +0000 (21:09 +0300)
committerPanu Matilainen <pmatilai@turre.koti.laiskiainen.org>
Sun, 8 Jul 2007 18:09:32 +0000 (21:09 +0300)
apt-pkg/pkgcachegen.cc
apt-pkg/rpm/rpmindexfile.cc

index d743ec2..5d9c0e3 100644 (file)
@@ -686,6 +686,8 @@ static unsigned long ComputeSize(FileIterator Start,FileIterator End)
    {
       if ((*Start)->HasPackages() == false)
         continue;      
+      if ((*Start)->Exists() == false)
+        continue;
       TotalSize += (*Start)->Size();
    }
    return TotalSize;
index 8159899..a2c5ba5 100644 (file)
@@ -711,6 +711,10 @@ string rpmRepomdIndex::IndexFile(string Type) const
 
 bool rpmRepomdIndex::Exists() const
 {
+   /* repomd requires release to be present to find any other files */
+   if (!FileExists(ReleasePath())) {
+      return false;
+   }
    return FileExists(IndexPath());
 }