diff options
-rw-r--r-- | apt-pkg/depcache.cc | 15 | ||||
-rw-r--r-- | apt-pkg/depcache.h | 1 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 7 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/examples/configure-index | 4 |
6 files changed, 22 insertions, 9 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 58d1d25e5..8560ce4fd 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -17,7 +17,6 @@ #include <apt-pkg/sptr.h> #include <apt-pkg/algorithms.h> #include <apt-pkg/configuration.h> - #include <apti18n.h> /*}}}*/ @@ -610,7 +609,8 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, installed */ StateCache &P = PkgState[Pkg->ID]; P.iFlags &= ~AutoKept; - if (P.InstBroken() == false && (P.Mode == ModeInstall || + if ((P.InstPolicyBroken() == false && P.InstBroken() == false) && + (P.Mode == ModeInstall || P.CandidateVer == (Version *)Pkg.CurrentVer())) { if (P.CandidateVer == (Version *)Pkg.CurrentVer() && P.InstallVer == 0) @@ -621,11 +621,9 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, // See if there is even any possible instalation candidate if (P.CandidateVer == 0) return; - // We dont even try to install virtual packages.. if (Pkg->VersionList == 0) return; - /* Target the candidate version and remove the autoflag. We reset the autoflag below if this was called recursively. Otherwise the user should have the ability to de-auto a package by changing its state */ @@ -869,6 +867,13 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator Pkg) /* */ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep) { - return Dep.IsCritical(); + if(Dep.IsCritical()) + return true; + else if(Dep->Type == pkgCache::Dep::Recommends) + return _config->FindB("APT::Install-Recommends", false); + else if(Dep->Type == pkgCache::Dep::Suggests) + return _config->FindB("APT::Install-Suggests", false); + + return false; } /*}}}*/ diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 6d51920e9..3f9f67140 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -98,6 +98,7 @@ class pkgDepCache : protected pkgCache::Namespace inline bool Held() const {return Status != 0 && Keep();}; inline bool NowBroken() const {return (DepState & DepNowMin) != DepNowMin;}; inline bool InstBroken() const {return (DepState & DepInstMin) != DepInstMin;}; + inline bool InstPolicyBroken() const {return (DepState & DepInstPolicy) != DepInstPolicy;}; inline bool Install() const {return Mode == ModeInstall;}; inline VerIterator InstVerIter(pkgCache &Cache) {return VerIterator(Cache,InstallVer);}; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 64882e3e8..7b7780a48 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1145,9 +1145,11 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache, else ExpectedInst++; - // Install it with autoinstalling enabled. - if (State.InstBroken() == true && BrokenFix == false) + // Install it with autoinstalling enabled (if we not respect the minial + // required deps or the policy) + if ((State.InstBroken() == true || State.InstPolicyBroken() == true) && BrokenFix == false) Cache.MarkInstall(Pkg,true); + return true; } /*}}}*/ @@ -2540,6 +2542,7 @@ int main(int argc,const char *argv[]) {0,"only-source","APT::Get::Only-Source",0}, {0,"arch-only","APT::Get::Arch-Only",0}, {0,"allow-unauthenticated","APT::Get::AllowUnauthenticated",0}, + {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; diff --git a/configure.in b/configure.in index fc4eff203..f0b0d6703 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.45") +AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index a84146d20..de9a43d49 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,7 +8,7 @@ apt (0.6.45.1) unstable; urgency=low - properly handle recommends/suggests or-groups when printing the list of suggested/recommends packages (closes: #311619) - -- + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 9 Aug 2006 14:27:54 +0200 apt (0.6.45) unstable; urgency=low diff --git a/doc/examples/configure-index b/doc/examples/configure-index index f8abd75ed..c4329dfa0 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -90,6 +90,10 @@ APT Cache-Limit "4194304"; Default-Release ""; + // consider Recommends, Suggests as important dependencies that should + // be installed by default + APT::Install-Recommends "false"; + APT::Install-Suggests "false"; // Write progress messages on this fd (for stuff like base-config) Status-Fd "-1"; |