From 1019948cea2e6adbd4b0df3f07b52c90187b1a05 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 16 Jun 2010 17:48:37 +0200 Subject: * apt-pkg/depcache.cc: - SetCandidateVer for all pseudo packages - SetReInstall for the "all" package of a pseudo package --- apt-pkg/depcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index c6f245a80..72d7cce5d 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -405,7 +405,7 @@ class pkgDepCache : protected pkgCache::Namespace bool ForceImportantDeps = false); void SetReInstall(PkgIterator const &Pkg,bool To); - void SetCandidateVersion(VerIterator TargetVer); + void SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo = true); /** Set the "is automatically installed" flag of Pkg. */ void MarkAuto(const PkgIterator &Pkg, bool Auto); -- cgit v1.2.3 From 1f2933a8de0f3a26f51b4a0a2112cbdfd4461e9b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 26 Jun 2010 13:29:24 +0200 Subject: - use the new MatchAgainstConfig for the DefaultRootSetFunc * apt-pkg/contrib/configuration.{cc,h}: - add a wrapper to match strings against configurable regex patterns --- apt-pkg/depcache.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 72d7cce5d..66c099b80 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -38,11 +38,10 @@ #ifndef PKGLIB_DEPCACHE_H #define PKGLIB_DEPCACHE_H - +#include #include #include - -#include +#include #include #include @@ -184,22 +183,13 @@ class pkgDepCache : protected pkgCache::Namespace /** \brief Returns \b true for packages matching a regular * expression in APT::NeverAutoRemove. */ - class DefaultRootSetFunc : public InRootSetFunc + class DefaultRootSetFunc : public InRootSetFunc, public Configuration::MatchAgainstConfig { - std::vector rootSetRegexp; - bool constructedSuccessfully; - public: - DefaultRootSetFunc(); - ~DefaultRootSetFunc(); - - /** \return \b true if the class initialized successfully, \b - * false otherwise. Used to avoid throwing an exception, since - * APT classes generally don't. - */ - bool wasConstructedSuccessfully() const { return constructedSuccessfully; } + DefaultRootSetFunc() : Configuration::MatchAgainstConfig("APT::NeverRemove") {}; + virtual ~DefaultRootSetFunc() {}; - bool InRootSet(const pkgCache::PkgIterator &pkg); + bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == true && Match(pkg.Name()); }; }; struct StateCache -- cgit v1.2.3 From e841200b9389ffc90e290310207bcb47e8a52be2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 4 Jul 2010 14:23:20 +0200 Subject: * apt-pkg/policy.h: - add another round of const& madness as the previous round accidently NOT override the virtual GetCandidateVer() method (Closes: #587725) --- apt-pkg/depcache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 66c099b80..45276dc95 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -256,8 +256,8 @@ class pkgDepCache : protected pkgCache::Namespace { public: - virtual VerIterator GetCandidateVer(PkgIterator Pkg); - virtual bool IsImportantDep(DepIterator Dep); + virtual VerIterator GetCandidateVer(PkgIterator const &Pkg); + virtual bool IsImportantDep(DepIterator const &Dep); virtual ~Policy() {}; }; @@ -334,7 +334,7 @@ class pkgDepCache : protected pkgCache::Namespace inline pkgVersioningSystem &VS() {return *Cache->VS;}; // Policy implementation - inline VerIterator GetCandidateVer(PkgIterator Pkg) {return LocalPolicy->GetCandidateVer(Pkg);}; + inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return LocalPolicy->GetCandidateVer(Pkg);}; inline bool IsImportantDep(DepIterator Dep) {return LocalPolicy->IsImportantDep(Dep);}; inline Policy &GetPolicy() {return *LocalPolicy;}; -- cgit v1.2.3