+// PM::GetArchives - Queue the archives for download /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
+ pkgRecords *Recs)
+{
+ if (CreateOrderList() == false)
+ return false;
+
+ bool const ordering =
+ _config->FindB("PackageManager::UnpackAll",true) ?
+ List->OrderUnpack() : List->OrderCritical();
+ if (ordering == false)
+ return _error->Error("Internal ordering error");
+
+ for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+ {
+ PkgIterator Pkg(Cache,*I);
+ FileNames[Pkg->ID] = string();
+
+ // Skip packages to erase
+ if (Cache[Pkg].Delete() == true)
+ continue;
+
+ // Skip Packages that need configure only.
+ if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
+ Cache[Pkg].Keep() == true)
+ continue;
+
+ // Skip already processed packages
+ if (List->IsNow(Pkg) == false)
+ continue;
+
+ if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == true)
+ continue;
+
+ new pkgAcqArchive(Owner,Sources,Recs,Cache[Pkg].InstVerIter(Cache),
+ FileNames[Pkg->ID]);
+ }
+
+ return true;
+}
+ /*}}}*/