From c8d49419be9ce10ade643370bf29891f76b5c339 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 27 Aug 2013 14:07:52 +0200 Subject: add new "apt-get upgrade --with-allow-new" option The --with-allow-new option maps to APT::Get::UpgradeAllowNew and will allow "apt-get upgrade" to install new packages (but not to delete existing packages) --- apt-private/private-cmndline.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index aceb865d5..c0b5a875f 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -163,6 +163,9 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const addArg('s', "no-act", "APT::Get::Simulate", 0); } + if (CmdMatches("upgrade")) + addArg(0, "allow-new", "APT::Get::UpgradeAllowNew", CommandLine::Boolean); + // FIXME: move to the correct command(s) addArg('d',"download-only","APT::Get::Download-Only",0); addArg('y',"yes","APT::Get::Assume-Yes",0); -- cgit v1.2.3 From c678a0443518aa5e8f328f358fca7b35252df84e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 28 Aug 2013 11:28:40 +0200 Subject: add man-page, improve option, use --with-new-pkgs as the flag --- apt-private/private-cmndline.cc | 6 ++---- cmdline/apt-get.cc | 2 +- doc/apt-get.8.xml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index c0b5a875f..152256806 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -125,7 +125,8 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const addArg(0, "solver", "APT::Solver", CommandLine::HasArg); if (CmdMatches("upgrade")) { - addArg(0, "allow-new", "APT::Get::UpgradeAllowNew", 0); + addArg(0, "allow-new", "APT::Get::Upgrade-Allow-New", + CommandLine::Boolean); } } else if (CmdMatches("update")) @@ -163,9 +164,6 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const addArg('s', "no-act", "APT::Get::Simulate", 0); } - if (CmdMatches("upgrade")) - addArg(0, "allow-new", "APT::Get::UpgradeAllowNew", CommandLine::Boolean); - // FIXME: move to the correct command(s) addArg('d',"download-only","APT::Get::Download-Only",0); addArg('y',"yes","APT::Get::Assume-Yes",0); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 93c21651f..392eafe4f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1627,7 +1627,7 @@ void SigWinch(int) bool DoUpgrade(CommandLine &CmdL) { - if (_config->FindB("APT::Get::UpgradeAllowNew", false) == true) + if (_config->FindB("APT::Get::Upgrade-Allow-New", false) == true) return DoUpgradeWithAllowNewPackages(CmdL); else return DoUpgradeNoNewPackages(CmdL); diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index cc4e82255..6ccd9e5ec 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -389,6 +389,18 @@ Configuration Item: APT::Ignore-Hold. + + Allow installing new packages when used in + conjunction with upgrade. This is useful if + the update of a installed package requires new dependencies to be + installed. Instead of holding the package back upgrade + will upgrade the package and install the new dependencies. Note that + upgrade with this option will never remove packages, + only allow adding new ones. + Configuration Item: APT::Get::Upgrade-Allow-New. + + + Do not upgrade packages; when used in conjunction with install, no-upgrade will prevent packages on the command line -- cgit v1.2.3 From 2004d64720b396ae2dc9d2a7f6bf7859d6d7ee9b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 28 Aug 2013 11:36:44 +0200 Subject: its --with-new-pkgs --- apt-private/private-cmndline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 152256806..b30eeffb7 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -125,7 +125,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const addArg(0, "solver", "APT::Solver", CommandLine::HasArg); if (CmdMatches("upgrade")) { - addArg(0, "allow-new", "APT::Get::Upgrade-Allow-New", + addArg(0, "new-pkgs", "APT::Get::Upgrade-Allow-New", CommandLine::Boolean); } } -- cgit v1.2.3