From 2a884c612b10b27f4be2cc6dd689bfe448d9361a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 17 Aug 2014 12:30:21 +0200 Subject: fix progress output for (dist-)upgrade calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, we had a start and a done of the calculation printed by higher-level code, but this got intermixed by progress reporting from an external solver or the output of autoremove codeā€¦ The higherlevel code is now only responsible for instantiating a progress object of its choosing (if it wants progress after all) and the rest will be handled by the upgrade code. Either it is used to show the progress of the external solver or the internal solver will give some hints about its overall progress. The later isn't really a proper progress as it will jump forward after each substep, but that is at least a bit better than before without any progress indication. Fixes also the 'strange' non-display of this progress line in -q=1, while all others are shown, which is reflected by all testcase changes. --- apt-pkg/algorithms.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index f35bd9a13..4d3bfa81f 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -136,12 +136,12 @@ class pkgProblemResolver /*{{{*/ inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected; Cache.MarkProtected(Pkg);}; inline void Remove(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= ToRemove;}; inline void Clear(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] &= ~(Protected | ToRemove);}; - - // Try to intelligently resolve problems by installing and removing packages - bool Resolve(bool BrokenFix = false); - + + // Try to intelligently resolve problems by installing and removing packages + bool Resolve(bool BrokenFix = false, OpProgress * const Progress = NULL); + // Try to resolve problems only by using keep - bool ResolveByKeep(); + bool ResolveByKeep(OpProgress * const Progress = NULL); APT_DEPRECATED void InstallProtect(); -- cgit v1.2.3 From 3809194b662f48733916e6248cd0c141f281313d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 29 Sep 2014 15:41:12 +0200 Subject: mark private methods as hidden We are the only possible users of private methods, so we are also the only users who can potentially export them via using them in inline methods. The point is: We don't need these symbols exported if we don't do this, so marking them as hidden removes some methods from the API without breaking anything as nobody could have used them. Git-Dch: Ignore --- apt-pkg/algorithms.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 4d3bfa81f..b6da1f2bf 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -82,9 +82,9 @@ class pkgSimulate : public pkgPackageManager /*{{{*/ virtual bool Remove(PkgIterator Pkg,bool Purge); private: - void ShortBreaks(); - void Describe(PkgIterator iPkg,std::ostream &out,bool Current,bool Candidate); - + APT_HIDDEN void ShortBreaks(); + APT_HIDDEN void Describe(PkgIterator iPkg,std::ostream &out,bool Current,bool Candidate); + public: pkgSimulate(pkgDepCache *Cache); @@ -114,7 +114,7 @@ class pkgProblemResolver /*{{{*/ // Sort stuff static pkgProblemResolver *This; - static int ScoreSort(const void *a,const void *b) APT_PURE; + APT_HIDDEN static int ScoreSort(const void *a,const void *b) APT_PURE; struct PackageKill { @@ -122,12 +122,12 @@ class pkgProblemResolver /*{{{*/ DepIterator Dep; }; - void MakeScores(); - bool DoUpgrade(pkgCache::PkgIterator Pkg); + APT_HIDDEN void MakeScores(); + APT_HIDDEN bool DoUpgrade(pkgCache::PkgIterator Pkg); + + APT_HIDDEN bool ResolveInternal(bool const BrokenFix = false); + APT_HIDDEN bool ResolveByKeepInternal(); - bool ResolveInternal(bool const BrokenFix = false); - bool ResolveByKeepInternal(); - protected: bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg); -- cgit v1.2.3 From fa5404ab01bdf06eaf147d9f133139e6c89b906a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 7 Nov 2014 18:18:14 +0100 Subject: explicit overload methods instead of adding parameters Adding a new parameter (with a default) is an ABI break, but you can overload a method, which is "just" an API break for everyone doing references to this method (aka: nobody). Git-Dch: Ignore --- apt-pkg/algorithms.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apt-pkg/algorithms.h') diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index b6da1f2bf..2ac28c0d7 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -138,10 +138,20 @@ class pkgProblemResolver /*{{{*/ inline void Clear(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] &= ~(Protected | ToRemove);}; // Try to intelligently resolve problems by installing and removing packages +#if APT_PKG_ABI >= 413 bool Resolve(bool BrokenFix = false, OpProgress * const Progress = NULL); +#else + bool Resolve(bool BrokenFix = false); + bool Resolve(bool BrokenFix, OpProgress * const Progress); +#endif // Try to resolve problems only by using keep +#if APT_PKG_ABI >= 413 bool ResolveByKeep(OpProgress * const Progress = NULL); +#else + bool ResolveByKeep(); + bool ResolveByKeep(OpProgress * const Progress); +#endif APT_DEPRECATED void InstallProtect(); -- cgit v1.2.3