From 6d38011bb93451dd9da3294614d821c77ac91687 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 30 Mar 2011 17:23:43 +0200 Subject: add a first round of stuff needed for talking between APT and solvers based on a very early draft for EDSP by Stefano APT can now write a scenario as well as load most stuff from it. --- apt-pkg/depcache.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 750da3d6f..b15cd527d 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -258,7 +258,9 @@ class pkgDepCache : protected pkgCache::Namespace virtual VerIterator GetCandidateVer(PkgIterator const &Pkg); virtual bool IsImportantDep(DepIterator const &Dep); - + virtual signed short GetPriority(PkgIterator const &Pkg); + virtual signed short GetPriority(PkgFileIterator const &File); + virtual ~Policy() {}; }; -- cgit v1.2.3 From cbc702ea5805ba63f6a032d38530879700f4d100 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 10:51:55 +0200 Subject: tell the resolver a package is set on hold if it was set by the user to Keep which happens for example if a user decides to "remove" a not installed package to forbid that it's part of the solution --- apt-pkg/depcache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index b15cd527d..f95ad9a14 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -232,6 +232,7 @@ class pkgDepCache : protected pkgCache::Namespace inline bool NewInstall() const {return Status == 2 && Mode == ModeInstall;}; inline bool Delete() const {return Mode == ModeDelete;}; inline bool Keep() const {return Mode == ModeKeep;}; + inline bool Protect() const {return (iFlags & Protected) == Protected;}; inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;}; inline bool Upgradable() const {return Status >= 1;}; inline bool Downgrade() const {return Status < 0 && Mode == ModeInstall;}; -- cgit v1.2.3 From 27e8981a61bb9881154e727deb3d4adf75ad4d0a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 18:19:24 +0200 Subject: remove deprecated methods which nobody should have used anyway like pseudo-package related and/or private --- apt-pkg/depcache.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index f95ad9a14..d3f9e3924 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -318,7 +318,6 @@ class pkgDepCache : protected pkgCache::Namespace // Count manipulators void AddSizes(const PkgIterator &Pkg, bool const &Invert = false); inline void RemoveSizes(const PkgIterator &Pkg) {AddSizes(Pkg, true);}; - void AddSizes(const PkgIterator &Pkg,signed long Mult) __deprecated; void AddStates(const PkgIterator &Pkg,int Add = 1); inline void RemoveStates(const PkgIterator &Pkg) {AddStates(Pkg,-1);}; @@ -399,8 +398,7 @@ class pkgDepCache : protected pkgCache::Namespace void MarkProtected(PkgIterator const &Pkg) { PkgState[Pkg->ID].iFlags |= Protected; }; void SetReInstall(PkgIterator const &Pkg,bool To); - // FIXME: Remove the unused boolean parameter on abi break - void SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo = true); + void SetCandidateVersion(VerIterator TargetVer); bool SetCandidateRelease(pkgCache::VerIterator TargetVer, std::string const &TargetRel); /** Set the candidate version for dependencies too if needed. @@ -485,13 +483,6 @@ class pkgDepCache : protected pkgCache::Namespace virtual ~pkgDepCache(); private: - // Helper for Update(OpProgress) to remove pseudoinstalled arch all packages - // FIXME: they are private so shouldn't affect abi, but just in caseā€¦ - __deprecated bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set &recheck) { return true; }; - __deprecated bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set &recheck) { return true; }; - __deprecated bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set &recheck) { return true; }; - - bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, unsigned long const Depth, bool const FromUser); }; -- cgit v1.2.3 From 6935cd05677544028e0d6baefc2e29933bf5fe8b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 18:22:18 +0200 Subject: * apt-pkg/depcache.cc: - use a boolean instead of an int for Add/Remove in AddStates similar to how it works with AddSizes --- 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 d3f9e3924..1a982ea18 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -316,10 +316,10 @@ class pkgDepCache : protected pkgCache::Namespace void Update(PkgIterator const &P); // Count manipulators - void AddSizes(const PkgIterator &Pkg, bool const &Invert = false); + void AddSizes(const PkgIterator &Pkg, bool const Invert = false); inline void RemoveSizes(const PkgIterator &Pkg) {AddSizes(Pkg, true);}; - void AddStates(const PkgIterator &Pkg,int Add = 1); - inline void RemoveStates(const PkgIterator &Pkg) {AddStates(Pkg,-1);}; + void AddStates(const PkgIterator &Pkg, bool const Invert = false); + inline void RemoveStates(const PkgIterator &Pkg) {AddStates(Pkg,true);}; public: -- cgit v1.2.3 From 3d619a202a6fbcaaaf6a6540b06c5deb3a50a3be Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 18:22:46 +0200 Subject: let the Mark methods return if their marking was successful --- 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 1a982ea18..2942558b0 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -388,11 +388,11 @@ class pkgDepCache : protected pkgCache::Namespace /** \name State Manipulators */ // @{ - void MarkKeep(PkgIterator const &Pkg, bool Soft = false, + bool MarkKeep(PkgIterator const &Pkg, bool Soft = false, bool FromUser = true, unsigned long Depth = 0); - void MarkDelete(PkgIterator const &Pkg, bool Purge = false, + bool MarkDelete(PkgIterator const &Pkg, bool Purge = false, unsigned long Depth = 0, bool FromUser = true); - void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true, + bool MarkInstall(PkgIterator const &Pkg,bool AutoInst = true, unsigned long Depth = 0, bool FromUser = true, bool ForceImportantDeps = false); void MarkProtected(PkgIterator const &Pkg) { PkgState[Pkg->ID].iFlags |= Protected; }; -- cgit v1.2.3 From b20c16833e20da8e367221b32764889cafe5b4c1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Jul 2011 13:55:15 +0200 Subject: [ABI break] merge patch from Jonathan Thomas to speed up the depcache by caching the install-recommends and install-suggests values --- apt-pkg/depcache.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index adc010c28..d935c1887 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -258,13 +258,21 @@ class pkgDepCache : protected pkgCache::Namespace class Policy { public: - + Policy() { + InstallRecommends = _config->FindB("APT::Install-Recommends", false); + InstallSuggests = _config->FindB("APT::Install-Suggests", false); + } + virtual VerIterator GetCandidateVer(PkgIterator const &Pkg); virtual bool IsImportantDep(DepIterator const &Dep); virtual signed short GetPriority(PkgIterator const &Pkg); virtual signed short GetPriority(PkgFileIterator const &File); virtual ~Policy() {}; + + private: + bool InstallRecommends; + bool InstallSuggests; }; private: -- cgit v1.2.3 From 8f3ba4e8708cb72be19dacc2af4f601ee5fea292 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 13:31:29 +0200 Subject: do not pollute namespace in the headers with using (Closes: #500198) --- 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 66cb7dbab..5798f0362 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -338,9 +338,9 @@ class pkgDepCache : protected pkgCache::Namespace inline Header &Head() {return *Cache->HeaderP;}; inline GrpIterator GrpBegin() {return Cache->GrpBegin();}; inline PkgIterator PkgBegin() {return Cache->PkgBegin();}; - inline GrpIterator FindGrp(string const &Name) {return Cache->FindGrp(Name);}; - inline PkgIterator FindPkg(string const &Name) {return Cache->FindPkg(Name);}; - inline PkgIterator FindPkg(string const &Name, string const &Arch) {return Cache->FindPkg(Name, Arch);}; + inline GrpIterator FindGrp(std::string const &Name) {return Cache->FindGrp(Name);}; + inline PkgIterator FindPkg(std::string const &Name) {return Cache->FindPkg(Name);}; + inline PkgIterator FindPkg(std::string const &Name, std::string const &Arch) {return Cache->FindPkg(Name, Arch);}; inline pkgCache &GetCache() {return *Cache;}; inline pkgVersioningSystem &VS() {return *Cache->VS;}; -- cgit v1.2.3 From 472ff00ef2e48383805d281c6364ec27839e3f4d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 19:14:19 +0200 Subject: use forward declaration in headers if possible instead of includes --- apt-pkg/depcache.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 5798f0362..f6e6c0afc 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -40,12 +40,13 @@ #include #include -#include -#include #include #include #include +#include + +class OpProgress; class pkgDepCache : protected pkgCache::Namespace { -- cgit v1.2.3 From b9dadc24b9477b466bc8058c765d76c65ecc7125 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Dec 2011 01:22:38 +0100 Subject: revert 2184.1.3: forward declaration instead of headers The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users --- apt-pkg/depcache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index f6e6c0afc..7358048ed 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -46,6 +46,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +#include +#include +#endif + class OpProgress; class pkgDepCache : protected pkgCache::Namespace -- cgit v1.2.3