From b917917067e757c4479a344a263ef7cf43c00866 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 12 Aug 2013 23:24:08 +0200 Subject: squash merge of the feature/apt-binary branch without the changes from experimental --- apt-private/private-upgrade.cc | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 apt-private/private-upgrade.cc (limited to 'apt-private/private-upgrade.cc') diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc new file mode 100644 index 000000000..85b5a492a --- /dev/null +++ b/apt-private/private-upgrade.cc @@ -0,0 +1,47 @@ + +#include + +#include "private-install.h" +#include "private-cachefile.h" +#include "private-upgrade.h" +#include "private-output.h" + + +// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/ +// --------------------------------------------------------------------- +/* Upgrade all packages without installing new packages or erasing old + packages */ +bool DoUpgradeNoNewPackages(CommandLine &CmdL) +{ + CacheFile Cache; + if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) + return false; + + // Do the upgrade + if (pkgAllUpgrade(Cache) == false) + { + ShowBroken(c1out,Cache,false); + return _error->Error(_("Internal error, AllUpgrade broke stuff")); + } + + return InstallPackages(Cache,true); +} + /*}}}*/ + +// DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/ +bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL) +{ + CacheFile Cache; + if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) + return false; + + // Do the upgrade + if (pkgAllUpgradeNoDelete(Cache) == false) + { + ShowBroken(c1out,Cache,false); + return _error->Error(_("Internal error, AllUpgrade broke stuff")); + } + + return InstallPackages(Cache,true); +} + /*}}}*/ -- cgit v1.2.3 From d8a8f9d7f01c75a7bbad7a488bf359a94291d1de Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 27 Aug 2013 08:50:06 +0200 Subject: allow pkg manipulation in the upgrade/dist-upgrade commandline, e.g. apt-get dist-upgrade 2vcard- 4g8+ --- apt-private/private-upgrade.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apt-private/private-upgrade.cc') diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc index eb546e3e3..09085c2db 100644 --- a/apt-private/private-upgrade.cc +++ b/apt-private/private-upgrade.cc @@ -13,9 +13,6 @@ packages */ bool DoUpgradeNoNewPackages(CommandLine &CmdL) { - if (CmdL.FileSize() != 1) - return _error->Error(_("The upgrade command takes no arguments")); - CacheFile Cache; if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) return false; @@ -26,6 +23,10 @@ bool DoUpgradeNoNewPackages(CommandLine &CmdL) ShowBroken(c1out,Cache,false); return _error->Error(_("Internal error, AllUpgrade broke stuff")); } + + // parse additional cmdline pkg manipulation switches + if(!DoCacheManipulationFromCommandLine(CmdL, Cache)) + return false; return InstallPackages(Cache,true); } @@ -34,9 +35,6 @@ bool DoUpgradeNoNewPackages(CommandLine &CmdL) // DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/ bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL) { - if (CmdL.FileSize() != 1) - return _error->Error(_("The upgrade command takes no arguments")); - CacheFile Cache; if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false) return false; @@ -47,6 +45,10 @@ bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL) ShowBroken(c1out,Cache,false); return _error->Error(_("Internal error, AllUpgrade broke stuff")); } + + // parse additional cmdline pkg manipulation switches + if(!DoCacheManipulationFromCommandLine(CmdL, Cache)) + return false; return InstallPackages(Cache,true); } -- cgit v1.2.3 From ee0167c4a0bf0c6de5437d3b641e7e7c0c614f17 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 30 Aug 2013 17:18:20 +0200 Subject: fix vim-style foldmarker Git-Dch: Ignore --- apt-private/private-upgrade.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apt-private/private-upgrade.cc') diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc index 09085c2db..9a5286b57 100644 --- a/apt-private/private-upgrade.cc +++ b/apt-private/private-upgrade.cc @@ -1,13 +1,13 @@ - +// Includes /*{{{*/ #include #include "private-install.h" #include "private-cachefile.h" #include "private-upgrade.h" #include "private-output.h" + /*}}}*/ - -// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/ +// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/ // --------------------------------------------------------------------- /* Upgrade all packages without installing new packages or erasing old packages */ @@ -31,7 +31,6 @@ bool DoUpgradeNoNewPackages(CommandLine &CmdL) return InstallPackages(Cache,true); } /*}}}*/ - // DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/ bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL) { -- cgit v1.2.3