+
+ // Run the simulator ..
+ if (_config->FindB("APT::Get::Simulate") == true)
+ {
+ pkgSimulate PM(Cache);
+ return PM.DoInstall();
+ }
+
+ // Create the text record parser
+ pkgRecords Recs(Cache);
+
+ // Create the download object
+ AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
+ pkgAcquire Fetcher(&Stat);
+
+ // Read the source list
+ pkgSourceList List;
+ if (List.ReadMainList() == false)
+ return _error->Error("The list of sources could not be read.");
+
+ // Create the package manager and prepare to download
+ pkgPackageManager PM(Cache);
+ if (PM.GetArchives(&Fetcher,&List,&Recs) == false)
+ return false;
+
+ unsigned long FetchBytes = Fetcher.FetchNeeded();
+ unsigned long DebBytes = Fetcher.TotalNeeded();
+ if (DebBytes != Cache.DebSize())
+ c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
+
+ c1out << "Need to get ";
+ if (DebBytes != FetchBytes)
+ c1out << SizeToStr(FetchBytes) << '/' << SizeToStr(DebBytes);
+ else
+ c1out << SizeToStr(DebBytes);
+
+ c1out << " of archives. After unpacking ";
+
+ if (Cache.UsrSize() >= 0)
+ c1out << SizeToStr(Cache.UsrSize()) << " will be used." << endl;
+ else
+ c1out << SizeToStr(-1*Cache.UsrSize()) << " will be freed." << endl;
+
+ if (_error->PendingError() == true)
+ return false;
+
+ if (Ask == true)
+ {