summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorAdam Conrad <adconrad@0c3.net>2013-01-18 01:09:43 -0700
committerAdam Conrad <adconrad@0c3.net>2013-01-18 01:09:43 -0700
commit68225779d1337336707c33c0265fc537ae256813 (patch)
tree6c4174f63b3014622f5b6132890846f5d47f1c29 /apt-pkg/depcache.cc
parent0dbd03a21542c03b0d9769787c8f794a697f3097 (diff)
* Merge from Debian unstable, pulling in new translations and fixes.
* Add linux-headers to /etc/kernel/postinst.d/apt-auto-removal guard. * Catalan (Jordi Mallach) * Drop a confusing non-breaking space. Closes: #691024 * Thai (Theppitak Karoonboonyanan). Closes: #691613 * Vietnamese (Trần Ngọc Quân). Closes: #693773 * Fix Plural forms in German, French, Japanese and Portuguese translations. Thanks to Jakub Wilk for reporting these errors. * apt-pkg/packagemanager.cc: - do not do lock-step configuration for a M-A:same package if it isn't unpacked yet in SmartConfigure and do not unpack a M-A:same package again in SmartUnPack if we have already configured it (LP: #1062503) * 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 * cmdline/apt-get.cc: - do not call Mark{Install,Delete} from the autoremove code with the FromUser bit set to avoid modifying the auto-installed bit * apt-pkg/algorithms.cc: - ensure pkgProblemResolver calls MarkDelete without FromUser set so that it can't overrule holds and the protection flag * change permissions of /var/log/apt/term.log to 0640 (LP: #975199) * apt-pkg/algorithms.cc: - fix package-pointer array memory leak in ResolveByKeepInternal() * Portuguese (Américo Monteiro) (Closes: #686975) * handle packages without a mandatory architecture (debian-policy §5.3) by introducing a pseudo-architecture 'none' so that the small group of users with these packages can get right of them without introducing too much hassle for other users (Closes: #686346) * merged the latest debian-sid fixes Correct fi translation for hash sum mismatches (lp:420403)
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index deb8ec21f..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;
@@ -1178,22 +1182,15 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
std::clog << OutputInDepth(Depth) << "Installing " << InstPkg.Name()
<< " as " << Start.DepType() << " of " << Pkg.Name()
<< std::endl;
- // now check if we should consider it a automatic dependency or not
- if(Pkg.Section() && ConfigValueInSubTree("APT::Never-MarkAuto-Sections", Pkg.Section()))
- {
+ MarkInstall(InstPkg, true, Depth + 1, false, ForceImportantDeps);
+ // now check if we should consider it a automatic dependency or not
+ if(InstPkg->CurrentVer == 0 && Pkg->Section != 0 && ConfigValueInSubTree("APT::Never-MarkAuto-Sections", Pkg.Section()))
+ {
if(DebugAutoInstall == true)
std::clog << OutputInDepth(Depth) << "Setting NOT as auto-installed (direct "
<< Start.DepType() << " of pkg in APT::Never-MarkAuto-Sections)" << std::endl;
- MarkInstall(InstPkg,true,Depth + 1, true);
- }
- else
- {
- // mark automatic dependency
- MarkInstall(InstPkg,true,Depth + 1, false, ForceImportantDeps);
- // Set the autoflag, after MarkInstall because MarkInstall unsets it
- if (InstPkg->CurrentVer == 0)
- PkgState[InstPkg->ID].Flags |= Flag::Auto;
- }
+ MarkAuto(InstPkg, false);
+ }
}
continue;
}