// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.56 1999/04/20 05:14:55 jgg Exp $
+// $Id: apt-get.cc,v 1.62 1999/06/04 02:31:37 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
}
// Run it
- if (Fetcher.Run() == false)
- return false;
+ if (_config->FindB("APT::Get::No-Download",false) == false)
+ if( Fetcher.Run() == false)
+ return false;
// Print out errors
bool Failed = false;
(*I)->Complete == true)
continue;
+ (*I)->Finished();
+
if ((*I)->Status == pkgAcquire::Item::StatIdle)
{
Transient = true;
}
if (_config->FindB("APT::Get::Download-Only",false) == true)
+ {
+ if (Failed == false && _config->FindB("APT::Get::Fix-Missing",false) == false)
+ return _error->Error("Some files failed to download");
return true;
+ }
if (Failed == true && _config->FindB("APT::Get::Fix-Missing",false) == false)
{
packages */
if (BrokenFix == true && Cache->BrokenCount() != 0)
{
- c1out << "You might want to run `apt-get -f install' to correct these." << endl;
+ c1out << "You might want to run `apt-get -f install' to correct these:" << endl;
ShowBroken(c1out,Cache);
- return _error->Error("Unmet dependencies. Try using -f.");
+ return _error->Error("Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).");
}
// Call the scored problem resolver
pkgSrcRecords::Parser *Last = 0;
unsigned long Offset = 0;
string Version;
+ bool IsMatch = false;
// Iterate over all of the hits
pkgSrcRecords::Parser *Parse;
while ((Parse = SrcRecs.Find(Src.c_str(),false)) != 0)
{
string Ver = Parse->Version();
- if (Last == 0 || pkgVersionCompare(Version,Ver) < 0)
+
+ // Skip name mismatches
+ if (IsMatch == true && Parse->Package() != Src)
+ continue;
+
+ // Newer version or an exact match
+ if (Last == 0 || pkgVersionCompare(Version,Ver) < 0 ||
+ (Parse->Package() == Src && IsMatch == false))
{
+ IsMatch = Parse->Package() == Src;
Last = Parse;
Offset = Parse->Offset();
Version = Ver;
c1out << SizeToStr(DebBytes) << 'b';
c1out << " of source archives." << endl;
+ if (_config->FindB("APT::Get::Simulate",false) == true)
+ {
+ for (unsigned I = 0; I != J; I++)
+ cout << "Fetch Source " << Dsc[I].Package << endl;
+ return true;
+ }
+
// Just print out the uris an exit if the --print-uris flag was used
if (_config->FindB("APT::Get::Print-URIs") == true)
{
cout << " -f Attempt to continue if the integrity check fails" << endl;
cout << " -m Attempt to continue if archives are unlocatable" << endl;
cout << " -u Show a list of upgraded packages as well" << endl;
+ cout << " -b Build the source package after fetching it" << endl;
cout << " -c=? Read this configuration file" << endl;
cout << " -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp" << endl;
cout << "See the apt-get(8), sources.list(5) and apt.conf(5) manual" << endl;
{'f',"fix-broken","APT::Get::Fix-Broken",0},
{'u',"show-upgraded","APT::Get::Show-Upgraded",0},
{'m',"ignore-missing","APT::Get::Fix-Missing",0},
+ {0,"no-download","APT::Get::No-Download",0},
{0,"fix-missing","APT::Get::Fix-Missing",0},
{0,"ignore-hold","APT::Ingore-Hold",0},
{0,"no-upgrade","APT::Get::no-upgrade",0},