From: Michael Vogt Date: Fri, 11 Aug 2006 10:45:33 +0000 (+0200) Subject: * merged the apt--install-recommends branch X-Git-Tag: 0.7.24ubuntu1~246 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/2ae2e04d97028b558bfe954e55a80513e0202889 * merged the apt--install-recommends branch * ABI break, bumped the version number --- 2ae2e04d97028b558bfe954e55a80513e0202889 diff --cc apt-pkg/depcache.cc index 27b6134b4,bfcb8e0eb..abe2842cc --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@@ -763,7 -598,7 +765,8 @@@ void pkgDepCache::MarkDelete(PkgIterato // --------------------------------------------------------------------- /* */ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, - unsigned long Depth, bool FromUser) - unsigned long Depth, bool ForceImportantDeps) ++ unsigned long Depth, bool FromUser, ++ bool ForceImportantDeps) { if (Depth > 100) return; @@@ -923,8 -747,13 +930,12 @@@ std::clog << "Installing " << InstPkg.Name() << " as dep of " << Pkg.Name() << std::endl; - MarkInstall(InstPkg, true, Depth + 1, false); - MarkInstall(InstPkg,true,Depth + 1, ForceImportantDeps); ++ MarkInstall(InstPkg,true,Depth + 1, false, ForceImportantDeps); + + // Set the autoflag, after MarkInstall because MarkInstall unsets it + if (P->CurrentVer == 0) + PkgState[InstPkg->ID].Flags |= Flag::Auto; } - continue; } diff --cc apt-pkg/depcache.h index d16b56bbc,042abb5cc..5cd5ea354 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@@ -342,61 -185,13 +344,62 @@@ class pkgDepCache : protected pkgCache: inline StateCache &operator [](PkgIterator const &I) {return PkgState[I->ID];}; inline unsigned char &operator [](DepIterator const &I) {return DepState[I->ID];}; - // Manipulators - void MarkKeep(PkgIterator const &Pkg,bool Soft = false); + /** \return A function identifying packages in the root set other + * than manually installed packages and essential packages, or \b + * NULL if an error occurs. + * + * \todo Is this the best place for this function? Perhaps the + * settings for mark-and-sweep should be stored in a single + * external class? + */ + virtual InRootSetFunc *GetRootSetFunc(); + + /** \return \b true if the garbage collector should follow recommendations. + */ + virtual bool MarkFollowsRecommends(); + + /** \return \b true if the garbage collector should follow suggestions. + */ + virtual bool MarkFollowsSuggests(); + + /** \brief Update the Marked and Garbage fields of all packages. + * + * This routine is implicitly invoked after all state manipulators + * and when an ActionGroup is destroyed. It invokes #MarkRequired + * and #Sweep to do its dirty work. + * + * \param rootFunc A predicate that returns \b true for packages + * that should be added to the root set. + */ + bool MarkAndSweep(InRootSetFunc &rootFunc) + { + return MarkRequired(rootFunc) && Sweep(); + } + + bool MarkAndSweep() + { + std::auto_ptr f(GetRootSetFunc()); + if(f.get() != NULL) + return MarkAndSweep(*f.get()); + else + return false; + } + + /** \name State Manipulators + */ + // @{ + void MarkKeep(PkgIterator const &Pkg, bool Soft = false, + bool FromUser = true); void MarkDelete(PkgIterator const &Pkg,bool Purge = false); void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true, - unsigned long Depth = 0, bool FromUser = true); - unsigned long Depth = 0, bool ForceImportantDeps = false); ++ unsigned long Depth = 0, bool FromUser = true, ++ bool ForceImportantDeps = false); void SetReInstall(PkgIterator const &Pkg,bool To); void SetCandidateVersion(VerIterator TargetVer); + + /** Set the "is automatically installed" flag of Pkg. */ + void MarkAuto(const PkgIterator &Pkg, bool Auto); + // @} // This is for debuging void Update(OpProgress *Prog = 0); diff --cc apt-pkg/init.h index 0c6260c2f,8255b406a..b036b8609 --- a/apt-pkg/init.h +++ b/apt-pkg/init.h @@@ -18,7 -18,7 +18,7 @@@ // See the makefile #define APT_PKG_MAJOR 3 - #define APT_PKG_MINOR 50 -#define APT_PKG_MINOR 11 ++#define APT_PKG_MINOR 51 #define APT_PKG_RELEASE 0 extern const char *pkgVersion; diff --cc apt-pkg/makefile index d03a19182,7e5feae53..6cc1414b2 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@@ -13,7 -13,7 +13,7 @@@ include ../buildlib/defaults.ma # methods/makefile - FIXME LIBRARY=apt-pkg LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER) - MAJOR=3.50 -MAJOR=3.11 ++MAJOR=3.51 MINOR=0 SLIBS=$(PTHREADLIB) $(INTLLIBS) APT_DOMAIN:=libapt-pkg$(MAJOR) diff --cc cmdline/apt-get.cc index d0330b08e,58976351c..96e974acb --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@@ -2615,9 -2555,9 +2629,10 @@@ int main(int argc,const char *argv[] {0,"remove","APT::Get::Remove",0}, {0,"only-source","APT::Get::Only-Source",0}, {0,"arch-only","APT::Get::Arch-Only",0}, + {0,"auto-remove","APT::Get::AutomaticRemove",0}, {0,"allow-unauthenticated","APT::Get::AllowUnauthenticated",0}, {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean}, + {0,"fix-policy","APT::Get::Fix-Policy-Broken",0}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; diff --cc configure.in index 5c573e72b,f0b0d6703..aa9abc1e6 --- a/configure.in +++ b/configure.in @@@ -18,7 -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.45ubuntu1") -AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1") ++AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu2") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --cc debian/changelog index b26aad6c0,65ec82cc1..946971906 --- a/debian/changelog +++ b/debian/changelog @@@ -1,4 -1,11 +1,14 @@@ -apt (0.6.45.2) unstable; urgency=low ++apt (0.6.45ubuntu3) edgy; urgency=low + - * added "--install-recommends" to handle recommends as - dependencies (closes: #42266) ++ * ABI break ++ * merged latest apt--install-recommends ++ * added "--fix-policy" option to can be used as "--fix-broken" and ++ will install missing weak depends (recommends, and/or suggests ++ depending on the settings) + + -- + -apt (0.6.45.1) unstable; urgency=low +apt (0.6.45ubuntu2) edgy; urgency=low * debian/control: - switched to libdb4.4 for building (closes: #381019) diff --cc methods/makefile index 03a424411,1e3b1ef85..2e3abe55c --- a/methods/makefile +++ b/methods/makefile @@@ -7,7 -7,7 +7,7 @@@ include ../buildlib/defaults.ma BIN := $(BIN)/methods # FIXME.. - LIB_APT_PKG_MAJOR = 3.50 -LIB_APT_PKG_MAJOR = 3.11 ++LIB_APT_PKG_MAJOR = 3.51 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR) # The file method