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