+ // Display statistics
+ unsigned long FetchBytes = Fetcher.FetchNeeded();
+ unsigned long DebBytes = Fetcher.TotalNeeded();
+ if (DebBytes != Cache->DebSize())
+ {
+ c0out << DebBytes << ',' << Cache->DebSize() << endl;
+ c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
+ }
+
+ // Check for enough free space
+ struct statfs Buf;
+ string OutputDir = _config->FindDir("Dir::Cache::Archives");
+ if (statfs(OutputDir.c_str(),&Buf) != 0)
+ return _error->Errno("statfs","Couldn't determine free space in %s",
+ OutputDir.c_str());
+ if (unsigned(Buf.f_bfree) < FetchBytes/Buf.f_bsize)
+ return _error->Error("Sorry, you don't have enough free space in %s",
+ OutputDir.c_str());
+
+ // Number of bytes
+ c1out << "Need to get ";
+ if (DebBytes != FetchBytes)
+ c1out << SizeToStr(FetchBytes) << "b/" << SizeToStr(DebBytes) << 'b';
+ else
+ c1out << SizeToStr(DebBytes) << 'b';
+
+ c1out << " of archives. After unpacking ";
+
+ // Size delta
+ if (Cache->UsrSize() >= 0)
+ c1out << SizeToStr(Cache->UsrSize()) << "b will be used." << endl;
+ else
+ c1out << SizeToStr(-1*Cache->UsrSize()) << "b will be freed." << endl;
+
+ if (_error->PendingError() == true)
+ return false;
+
+ // Fail safe check
+ if (_config->FindB("APT::Get::Assume-Yes",false) == true)
+ {
+ if (Fail == true && _config->FindB("APT::Get::Force-Yes",false) == false)
+ return _error->Error("There are problems and -y was used without --force-yes");
+ }
+
+ // Prompt to continue
+ if (Ask == true)
+ {
+ if (_config->FindI("quiet",0) < 2 ||
+ _config->FindB("APT::Get::Assume-Yes",false) == false)
+ c2out << "Do you want to continue? [Y/n] " << flush;
+
+ if (YnPrompt() == false)
+ exit(1);
+ }
+
+ if (_config->FindB("APT::Get::Print-URIs") == true)
+ {
+ pkgAcquire::UriIterator I = Fetcher.UriBegin();
+ for (; I != Fetcher.UriEnd(); I++)
+ cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
+ I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl;
+ return true;
+ }
+