X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d6e79b75582b25065e2e1e843191c93d1f56ec3a..9978c7b013773c56aa942305cc0c92994e7ee879:/cmdline/apt-get.cc diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0228bb395..ddf02a8f3 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1,6 +1,6 @@ // -*- 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 @@ -589,8 +589,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = } // 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; @@ -601,6 +602,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = (*I)->Complete == true) continue; + (*I)->Finished(); + if ((*I)->Status == pkgAcquire::Item::StatIdle) { Transient = true; @@ -614,7 +617,11 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = } 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) { @@ -839,10 +846,10 @@ bool DoInstall(CommandLine &CmdL) 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 @@ -1112,6 +1119,7 @@ bool DoSource(CommandLine &CmdL) pkgSrcRecords::Parser *Last = 0; unsigned long Offset = 0; string Version; + bool IsMatch = false; // Iterate over all of the hits pkgSrcRecords::Parser *Parse; @@ -1119,8 +1127,16 @@ bool DoSource(CommandLine &CmdL) 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; @@ -1183,6 +1199,13 @@ bool DoSource(CommandLine &CmdL) 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) { @@ -1321,6 +1344,7 @@ bool ShowHelp(CommandLine &CmdL) 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; @@ -1376,6 +1400,7 @@ int main(int argc,const char *argv[]) {'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},