// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.23 1998/12/05 04:36:10 jgg Exp $
+// $Id: apt-get.cc,v 1.32 1998/12/31 01:32:20 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;
for (;I.end() != true; I++)
if (Dep[I].Delete() == true)
List += string(I.Name()) + " ";
+
ShowList(out,"The following packages will be REMOVED:",List);
}
/*}}}*/
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();
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;
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)
{
// ShowHelp - Show a help screen /*{{{*/
// ---------------------------------------------------------------------
/* */
-int ShowHelp()
+bool ShowHelp(CommandLine &CmdL)
{
cout << PACKAGE << ' ' << VERSION << " for " << ARCHITECTURE <<
" compiled on " << __DATE__ << " " << __TIME__ << endl;
cout << " -u Show a list of upgraded packages as well" << endl;
cout << " -c=? Read this configuration file" << endl;
cout << " -o=? Set an arbitary configuration option, ie -o dir::cache=/tmp" << endl;
- cout << "See the apt-get(8), sources.list(8) and apt.conf(8) manual" << endl;
+ cout << "See the apt-get(8), sources.list(5) and apt.conf(5) manual" << endl;
cout << "pages for more information." << endl;
return 100;
}
{"dselect-upgrade",&DoDSelectUpgrade},
{"clean",&DoClean},
{"check",&DoCheck},
+ {"help",&ShowHelp},
{0,0}};
// Parse the command line and initialize the package library
// See if the help should be shown
if (_config->FindB("help") == true ||
CmdL.FileSize() == 0)
- return ShowHelp();
+ return ShowHelp(CmdL);
// Setup the output streams
c0out.rdbuf(cout.rdbuf());
{
bool Errors = _error->PendingError();
_error->DumpErrors();
- if (Errors == true)
- cout << "Returning 100." << endl;
return Errors == true?100:0;
}