// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.20 1998/11/27 01:52:58 jgg Exp $
+// $Id: apt-get.cc,v 1.28 1998/12/08 23:52:24 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
{
if (_config->FindB("APT::Get::Assume-Yes",false) == true)
{
- c2out << 'Y' << endl;
+ c1out << 'Y' << endl;
return true;
}
pkgCache::DepIterator Start;
pkgCache::DepIterator End;
D.GlobOr(Start,End);
-
+
if (Cache.IsImportantDep(End) == false ||
(Cache[End] & pkgDepCache::DepGInstall) == pkgDepCache::DepGInstall)
continue;
pkgMakeStatusCache(List,Progress);
if (_error->PendingError() == true)
return _error->Error("The package lists or status file could not be parsed or opened.");
+ if (_error->empty() == false)
+ _error->Warning("You may want to run apt-get update to correct theses missing files");
Progress.Done();
ShowNew(c1out,Cache);
if (ShwKept == true)
ShowKept(c1out,Cache);
- Fail |= ShowHold(c1out,Cache);
+ Fail |= !ShowHold(c1out,Cache);
if (_config->FindB("APT::Get::Show-Upgraded",false) == true)
ShowUpgraded(c1out,Cache);
- Fail |= ShowEssential(c1out,Cache);
+ Fail |= !ShowEssential(c1out,Cache);
Stats(c1out,Cache);
// Sanity check
if (Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
Cache->BadCount() == 0)
- return true;
+ return true;
// Run the simulator ..
if (_config->FindB("APT::Get::Simulate") == true)
}
// Number of bytes
- c1out << "Need to get ";
+ c2out << "Need to get ";
if (DebBytes != FetchBytes)
- c1out << SizeToStr(FetchBytes) << '/' << SizeToStr(DebBytes);
+ c2out << SizeToStr(FetchBytes) << '/' << SizeToStr(DebBytes);
else
- c1out << SizeToStr(DebBytes);
+ c2out << SizeToStr(DebBytes);
c1out << " of archives. After unpacking ";
// Size delta
if (Cache->UsrSize() >= 0)
- c1out << SizeToStr(Cache->UsrSize()) << " will be used." << endl;
+ c2out << SizeToStr(Cache->UsrSize()) << " will be used." << endl;
else
- c1out << SizeToStr(-1*Cache->UsrSize()) << " will be freed." << endl;
+ c2out << SizeToStr(-1*Cache->UsrSize()) << " will be freed." << endl;
if (_error->PendingError() == true)
return false;
// Print out errors
bool Failed = false;
+ bool Transient = false;
for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
{
if ((*I)->Status == pkgAcquire::Item::StatDone &&
(*I)->Complete == true)
continue;
+ if ((*I)->Status == pkgAcquire::Item::StatIdle)
+ {
+ Transient = true;
+ Failed = true;
+ continue;
+ }
+
cerr << "Failed to fetch " << (*I)->Describe() << endl;
cerr << " " << (*I)->ErrorText << endl;
Failed = true;
}
+
+ if (_config->FindB("APT::Get::Download-Only",false) == true)
+ return true;
- if (Failed == true && _config->FindB("APT::Fix-Missing",false) == false)
+ if (Failed == true && _config->FindB("APT::Get::Fix-Missing",false) == false)
+ {
+ if (Transient == true)
+ {
+ c2out << "Upgrading with disk swapping is not supported in this version." << endl;
+ c2out << "Try running multiple times with --fix-missing" << endl;
+ }
+
return _error->Error("Unable to fetch some archives, maybe try with --fix-missing?");
-
+ }
+
// Try to deal with missing package files
if (PM.FixMissing() == false)
{