// ---------------------------------------------------------------------
/* */
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;
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;
}
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<InRootSetFunc> 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);
// 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;
# 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)
{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}};
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)
-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)
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