summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-11-09 10:47:30 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-11-09 10:47:30 +0100
commit35f6b9ea8a28022607e3921475c165c06d5ead8a (patch)
treeaf1570eb1ef75cabceaa492c34c9cc4ce42498b0
parentc1e0a100d11e6e6d529d9f52375f979a9dbd4d04 (diff)
no mode changes should obviously be ok for pkgDepCache::IsModeChangeOk
-rw-r--r--apt-pkg/depcache.cc8
-rw-r--r--debian/changelog1
2 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 6ceb18492..2ec346f0b 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -913,11 +913,15 @@ bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
return true;
StateCache &P = PkgState[Pkg->ID];
+ // not changing the mode is obviously also fine as we might want to call
+ // e.g. MarkInstall multiple times with different arguments for the same package
+ if (P.Mode == mode)
+ return true;
// if previous state was set by user only user can reset it
if ((P.iFlags & Protected) == Protected)
{
- if (unlikely(DebugMarker == true) && P.Mode != mode)
+ if (unlikely(DebugMarker == true))
std::clog << OutputInDepth(Depth) << "Ignore Mark" << PrintMode(mode)
<< " of " << Pkg << " as its mode (" << PrintMode(P.Mode)
<< ") is protected" << std::endl;
@@ -927,7 +931,7 @@ bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
else if (mode != ModeKeep && Pkg->SelectedState == pkgCache::State::Hold &&
_config->FindB("APT::Ignore-Hold",false) == false)
{
- if (unlikely(DebugMarker == true) && P.Mode != mode)
+ if (unlikely(DebugMarker == true))
std::clog << OutputInDepth(Depth) << "Hold prevents Mark" << PrintMode(mode)
<< " of " << Pkg << std::endl;
return false;
diff --git a/debian/changelog b/debian/changelog
index 10a3b7252..7644320c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ apt (0.9.7.7) UNRELEASED; urgency=low
* apt-pkg/depcache.cc:
- don't call MarkInstall with the FromUser flag set for packages
which are dependencies of APT::Never-MarkAuto-Sections matchers
+ - no mode changes should obviously be ok for pkgDepCache::IsModeChangeOk
-- Jordi Mallach <jordi@debian.org> Thu, 18 Oct 2012 23:30:46 +0200