// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.75 1999/09/09 06:27:42 jgg Exp $
+// $Id: apt-get.cc,v 1.77 1999/09/30 06:30:34 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
/* This prints out the names of all the packages that are broken along
with the name of each each broken dependency and a quite version
description. */
-void ShowBroken(ostream &out,CacheFile &Cache)
+void ShowBroken(ostream &out,CacheFile &Cache,bool Now)
{
out << "Sorry, but the following packages have unmet dependencies:" << endl;
for (unsigned J = 0; J < Cache->Head().PackageCount; J++)
")";
/* Show a summary of the target package if possible. In the case
- of virtual packages we show nothing */
-
+ of virtual packages we show nothing */
pkgCache::PkgIterator Targ = End.TargetPkg();
if (Targ->ProvidesList == 0)
{
out << " but ";
pkgCache::VerIterator Ver = Cache[Targ].InstVerIter(Cache);
if (Ver.end() == false)
- out << Ver.VerStr() << " is installed";
+ out << Ver.VerStr() << (Now?" is installed":" is to be installed");
else
{
if (Cache[Targ].CandidateVerIter(Cache).end() == true)
out << "it is a virtual package";
}
else
- out << "it is not installed";
+ out << (Now?"it is not installed":"it is not going to be installed");
}
}
if (pkgFixBroken(*Cache) == false || Cache->BrokenCount() != 0)
{
c1out << " failed." << endl;
- ShowBroken(c1out,*this);
+ ShowBroken(c1out,*this,true);
return _error->Error("Unable to correct dependencies");
}
else
{
c1out << "You might want to run `apt-get -f install' to correct these." << endl;
- ShowBroken(c1out,*this);
+ ShowBroken(c1out,*this,true);
return _error->Error("Unmet dependencies. Try using -f.");
}
// Sanity check
if (Cache->BrokenCount() != 0)
{
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return _error->Error("Internal Error, InstallPackages was called with broken packages!");
}
(*I)->Finished();
+ cerr << "Failed to fetch " << (*I)->DescURI() << endl;
+ cerr << " " << (*I)->ErrorText << endl;
Failed = true;
}
// Do the upgrade
if (pkgAllUpgrade(Cache) == false)
{
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return _error->Error("Internal Error, AllUpgrade broke stuff");
}
if (BrokenFix == true && Cache->BrokenCount() != 0)
{
c1out << "You might want to run `apt-get -f install' to correct these:" << endl;
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return _error->Error("Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).");
}
c1out << "The following information may help to resolve the situation:" << endl;
c1out << endl;
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return _error->Error("Sorry, broken packages");
}
if (pkgDistUpgrade(*Cache) == false)
{
c0out << "Failed" << endl;
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return false;
}
if (Fix.Resolve() == false)
{
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return _error->Error("Internal Error, problem resolver broke stuff");
}
}
// Now upgrade everything
if (pkgAllUpgrade(Cache) == false)
{
- ShowBroken(c1out,Cache);
+ ShowBroken(c1out,Cache,false);
return _error->Error("Internal Error, problem resolver broke stuff");
}