diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:03 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:03 +0000 |
commit | d150b09d5e8bef0f47d350f6147a98a15c795f6a (patch) | |
tree | 53dc4853c6a04f3bbabfb379751d5f8652b77a66 | |
parent | 0c55d1d210d445b85116ea5add79e25a928d0d5a (diff) |
--trivial-only and --no-remove. --trivial-only and --no...
Author: jgg
Date: 1999-10-28 05:54:45 GMT
--trivial-only and --no-remove. --trivial-only and --no-remove.
-rw-r--r-- | cmdline/apt-get.cc | 26 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/apt-get.8.yo | 9 | ||||
-rw-r--r-- | doc/examples/apt.conf | 5 |
4 files changed, 33 insertions, 8 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0706d1c74..217239b0d 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.86 1999/10/27 05:00:25 jgg Exp $ +// $Id: apt-get.cc,v 1.87 1999/10/28 05:54:45 jgg Exp $ /* ###################################################################### apt-get - Cover for dpkg @@ -554,6 +554,10 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = Cache->BadCount() == 0) return true; + // No remove flag + if (Cache->DelCount() != 0 && _config->FindB("APT::Get::No-Remove",false) == true) + return _error->Error("Packages need to be removed but No Remove was specified."); + // Run the simulator .. if (_config->FindB("APT::Get::Simulate") == true) { @@ -643,6 +647,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = if (Essential == true && Saftey == true) { + if (_config->FindB("APT::Get::Trivial-Only",false) == true) + return _error->Error("Trivial Only specified but this is not a trivial operation."); + c2out << "You are about to do something potentially harmful" << endl; c2out << "To continue type in the phrase 'Yes, I understand this may be bad'" << endl; c2out << " ?] " << flush; @@ -653,10 +660,13 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey = } } else - { + { // Prompt to continue if (Ask == true || Fail == true) { + if (_config->FindB("APT::Get::Trivial-Only",false) == true) + return _error->Error("Trivial Only specified but this is not a trivial operation."); + if (_config->FindI("quiet",0) < 2 && _config->FindB("APT::Get::Assume-Yes",false) == false) { @@ -1637,11 +1647,11 @@ int main(int argc,const char *argv[]) {'d',"download-only","APT::Get::Download-Only",0}, {'b',"compile","APT::Get::Compile",0}, {'b',"build","APT::Get::Compile",0}, - {'s',"simulate","APT::Get::Simulate",0}, - {'s',"just-print","APT::Get::Simulate",0}, - {'s',"recon","APT::Get::Simulate",0}, - {'s',"no-act","APT::Get::Simulate",0}, - {'y',"yes","APT::Get::Assume-Yes",0}, + {'s',"simulate","APT::Get::Simulate",0}, + {'s',"just-print","APT::Get::Simulate",0}, + {'s',"recon","APT::Get::Simulate",0}, + {'s',"no-act","APT::Get::Simulate",0}, + {'y',"yes","APT::Get::Assume-Yes",0}, {'y',"assume-yes","APT::Get::Assume-Yes",0}, {'f',"fix-broken","APT::Get::Fix-Broken",0}, {'u',"show-upgraded","APT::Get::Show-Upgraded",0}, @@ -1657,6 +1667,8 @@ int main(int argc,const char *argv[]) {0,"purge","APT::Get::Purge",0}, {0,"list-cleanup","APT::Get::List-Cleanup",0}, {0,"reinstall","APT::Get::ReInstall",0}, + {0,"trivial-only","APT::Get::Trivial-Only",0}, + {0,"no-remove","APT::Get::No-Remove",0}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; diff --git a/debian/changelog b/debian/changelog index 272e506bd..6a83a5844 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,7 @@ apt (0.3.13.1) unstable; urgency=low * Locks archive directory on clean (woops) * Remove is not 'sticky'. Closes: #48392 * Slightly more accurate 'can not find package' message. Closes: #48311 + * --trivial-only and --no-remove. Closes: #48518 -- Jason Gunthorpe <jgg@debian.org> Fri, 3 Sep 1999 09:04:28 -0700 diff --git a/doc/apt-get.8.yo b/doc/apt-get.8.yo index cb716015b..3266581f7 100644 --- a/doc/apt-get.8.yo +++ b/doc/apt-get.8.yo @@ -226,6 +226,15 @@ When on apt-get will automatically manage the contents of reason to turn it off is if you frequently change your source list. See bf(APT::Get::List-Cleanup) +dit(bf(--trivial-only)) +Only perform operations are 'trivial'. Logically this can be considered +related to --assume-yes, where --assume-yes will answer yes to any prompt, +--trivial-only will answer no. See bf(APT::Get::Trivial-Only) + +dit(bf(--no-remove)) +If any packages are to be removed apt-get immediately aborts without +prompting. See bf(APT::Get::No-Remove) + dit(bf(--diff-only), bd(--tar-only)) Download only the diff or tar file of a source archive. diff --git a/doc/examples/apt.conf b/doc/examples/apt.conf index 2249cadba..bd09694b5 100644 --- a/doc/examples/apt.conf +++ b/doc/examples/apt.conf @@ -1,4 +1,4 @@ -// $Id: apt.conf,v 1.39 1999/10/22 04:05:48 jgg Exp $ +// $Id: apt.conf,v 1.40 1999/10/28 05:54:46 jgg Exp $ /* This file is an index of all APT configuration directives. It should NOT actually be used as a real config file, though it is a completely valid file. Most of the options have sane default values, unless @@ -38,6 +38,9 @@ APT No-Download "false"; Purge "false"; List-Cleanup "true"; + ReInstall "false"; + Trivial-Only "false"; + No-Remove "false"; }; Cache |