Browse Source

Don't download "optional" files not in Release :/.

Jay Freeman (saurik) 7 years ago
parent
commit
fb97f9603a
1 changed files with 8 additions and 1 deletions
  1. 8 1
      apt-pkg/acquire-item.cc

+ 8 - 1
apt-pkg/acquire-item.cc

@@ -1411,7 +1411,7 @@ void pkgAcqMetaClearSig::QueueIndexes(bool const verify)			/*{{{*/
 	 if (TransactionManager->MetaIndexParser->Exists(Target.MetaKey) == false)
 	 {
 	    // optional targets that we do not have in the Release file are skipped
-	    if (hasHashes == true && Target.IsOptional)
+	    if (Target.IsOptional)
 	    {
 	       new CleanupItem(Owner, TransactionManager, Target);
 	       continue;
@@ -1535,6 +1535,13 @@ void pkgAcqMetaClearSig::QueueIndexes(bool const verify)			/*{{{*/
       }
       else
       {
+	 // if the source wanted these files they should have given us a release file :/
+	 if (Target.IsOptional)
+	 {
+	    new CleanupItem(Owner, TransactionManager, Target);
+	    continue;
+	 }
+
 	 // if we have no file to patch, no point in trying
 	 trypdiff &= (GetExistingFilename(GetFinalFileNameFromURI(Target.URI)).empty() == false);
       }