From facea693b2078327b59502e663c238c50118e96a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 18 Sep 2013 17:55:44 +0200 Subject: improve the API for Upgrade() --- apt-pkg/algorithms.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index a499db8ba..9ff84e3ff 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -45,6 +45,15 @@ using std::ostream; class pkgAcquireStatus; +namespace APT { + namespace Upgrade { + enum UpgradeMode {NO_INSTALL_OR_REMOVE, + ALLOW_NEW_INSTALLS, + ALLOW_REMOVAL_AND_NEW_INSTALLS}; + bool Upgrade(pkgDepCache &Cache, UpgradeMode mode); + } +} + class pkgSimulate : public pkgPackageManager /*{{{*/ { protected: @@ -85,6 +94,7 @@ private: /*}}}*/ class pkgProblemResolver /*{{{*/ { + private: /** \brief dpointer placeholder (for later in case we need it) */ void *d; @@ -146,8 +156,6 @@ bool pkgFixBroken(pkgDepCache &Cache); bool pkgAllUpgrade(pkgDepCache &Cache); -bool pkgAllUpgradeNoDelete(pkgDepCache &Cache); - bool pkgMinimizeUpgrade(pkgDepCache &Cache); void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List); -- cgit v1.2.3 From 5ca0cf51194422fb0f094bbf5e61e9f5eb57f013 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 5 Oct 2013 11:54:08 +0200 Subject: cleanup upgrade API some more (thanks for the feedback from David) --- apt-pkg/algorithms.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 9ff84e3ff..d0de72462 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -47,10 +47,12 @@ class pkgAcquireStatus; namespace APT { namespace Upgrade { - enum UpgradeMode {NO_INSTALL_OR_REMOVE, - ALLOW_NEW_INSTALLS, - ALLOW_REMOVAL_AND_NEW_INSTALLS}; - bool Upgrade(pkgDepCache &Cache, UpgradeMode mode); + // FIXME: make this "enum class UpgradeMode {" once we enable c++11 + enum UpgradeMode { + FORBID_REMOVE_PACKAGES = 1, + FORBID_NEW_INSTALL_PACKAGES = 2, + }; + bool Upgrade(pkgDepCache &Cache, int UpgradeMode); } } -- cgit v1.2.3 From 82e369c4b93b5b81db7988ab377a3c5bd388268e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 5 Oct 2013 12:15:03 +0200 Subject: * move upgrade releated code into upgrade.{cc,h} The upgrade releated code is moved into upgrade.{cc,h} and all pkg*Upgrade* prototypes are included in algorihms.h to avoid breaking API (unless build with APT_9_CLEANER_HEADERS). --- apt-pkg/algorithms.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index d0de72462..9dfa1538a 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -40,21 +40,16 @@ #ifndef APT_8_CLEANER_HEADERS #include +// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatiblity using std::ostream; #endif +#ifndef APT_9_CLEANER_HEADERS +#include +#endif + class pkgAcquireStatus; -namespace APT { - namespace Upgrade { - // FIXME: make this "enum class UpgradeMode {" once we enable c++11 - enum UpgradeMode { - FORBID_REMOVE_PACKAGES = 1, - FORBID_NEW_INSTALL_PACKAGES = 2, - }; - bool Upgrade(pkgDepCache &Cache, int UpgradeMode); - } -} class pkgSimulate : public pkgPackageManager /*{{{*/ { @@ -152,14 +147,9 @@ class pkgProblemResolver /*{{{*/ ~pkgProblemResolver(); }; /*}}}*/ -bool pkgDistUpgrade(pkgDepCache &Cache); bool pkgApplyStatus(pkgDepCache &Cache); bool pkgFixBroken(pkgDepCache &Cache); -bool pkgAllUpgrade(pkgDepCache &Cache); - -bool pkgMinimizeUpgrade(pkgDepCache &Cache); - void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List); bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0); -- cgit v1.2.3 From d428d131a29a08fa7c1d95b98b684fb2ebb554c0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 5 Oct 2013 12:22:55 +0200 Subject: Move ListUpdate/AquireUpdate into update.{cc,h} This moves the ListUpdate/AquireUpdate out of the "catch-all" algorithm.{cc,h} file into its own update.{cc,h} --- apt-pkg/algorithms.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 9dfa1538a..80f6578eb 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -46,10 +46,9 @@ using std::ostream; #ifndef APT_9_CLEANER_HEADERS #include +#include #endif -class pkgAcquireStatus; - class pkgSimulate : public pkgPackageManager /*{{{*/ { @@ -152,8 +151,5 @@ bool pkgFixBroken(pkgDepCache &Cache); void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List); -bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0); -bool AcquireUpdate(pkgAcquire &Fetcher, int const PulseInterval = 0, - bool const RunUpdateScripts = true, bool const ListCleanup = true); #endif -- cgit v1.2.3 From 61f954bff040809e7ab57b3adec2fe95339ffb94 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 1 Nov 2013 10:42:49 +0100 Subject: small documentation updates --- apt-pkg/algorithms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 80f6578eb..5a9a77415 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -40,11 +40,11 @@ #ifndef APT_8_CLEANER_HEADERS #include -// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatiblity using std::ostream; #endif #ifndef APT_9_CLEANER_HEADERS +// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatiblity #include #include #endif -- cgit v1.2.3