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 + apt-pkg/edsp.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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;}; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index d72370358..8bd0c14bb 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -61,7 +61,8 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI fprintf(output, "Version: %s\n", Ver.VerStr()); if (Pkg.CurrentVer() == Ver) fprintf(output, "Installed: yes\n"); - if (Pkg->SelectedState == pkgCache::State::Hold) + if (Pkg->SelectedState == pkgCache::State::Hold || + (Cache[Pkg].Keep() == true && Cache[Pkg].Protect() == true)) fprintf(output, "Hold: yes\n"); fprintf(output, "APT-ID: %d\n", Ver->ID); fprintf(output, "Priority: %s\n", PrioMap[Ver->Priority]); -- cgit v1.2.3