X-Git-Url: https://git.hcoop.net/ntk/apt.git/blobdiff_plain/b093a199056673b55e6467ab9e22e8af15183c43..cc26da01ef43686d67959ef080e5492410d20e4e:/apt-pkg/depcache.h diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 08e68355..750da3d6 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -119,7 +119,7 @@ class pkgDepCache : protected pkgCache::Namespace DepCandPolicy = (1 << 4), DepCandMin = (1 << 5)}; // These flags are used in StateCache::iFlags - enum InternalFlags {AutoKept = (1 << 0), Purge = (1 << 1), ReInstall = (1 << 2)}; + enum InternalFlags {AutoKept = (1 << 0), Purge = (1 << 1), ReInstall = (1 << 2), Protected = (1 << 3)}; enum VersionTypes {NowVersion, InstallVersion, CandidateVersion}; enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2}; @@ -189,7 +189,7 @@ class pkgDepCache : protected pkgCache::Namespace DefaultRootSetFunc() : Configuration::MatchAgainstConfig("APT::NeverAutoRemove") {}; virtual ~DefaultRootSetFunc() {}; - bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == true && Match(pkg.Name()); }; + bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == false && Match(pkg.Name()); }; }; struct StateCache @@ -393,9 +393,30 @@ class pkgDepCache : protected pkgCache::Namespace void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true, unsigned long Depth = 0, bool FromUser = true, bool ForceImportantDeps = false); + void MarkProtected(PkgIterator const &Pkg) { PkgState[Pkg->ID].iFlags |= Protected; }; void SetReInstall(PkgIterator const &Pkg,bool To); + // FIXME: Remove the unused boolean parameter on abi break void SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo = true); + bool SetCandidateRelease(pkgCache::VerIterator TargetVer, + std::string const &TargetRel); + /** Set the candidate version for dependencies too if needed. + * + * Sets not only the candidate version as SetCandidateVersion does, + * but walks also down the dependency tree and checks if it is required + * to set the candidate of the dependency to a version from the given + * release, too. + * + * \param TargetVer new candidate version of the package + * \param TargetRel try to switch to this release if needed + * \param[out] Changed a list of pairs consisting of the \b old + * version of the changed package and the version which + * required the switch of this dependency + * \return \b true if the switch was successful, \b false otherwise + */ + bool SetCandidateRelease(pkgCache::VerIterator TargetVer, + std::string const &TargetRel, + std::list > &Changed); /** Set the "is automatically installed" flag of Pkg. */ void MarkAuto(const PkgIterator &Pkg, bool Auto); @@ -462,9 +483,14 @@ class pkgDepCache : protected pkgCache::Namespace private: // Helper for Update(OpProgress) to remove pseudoinstalled arch all packages - bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set &recheck); - bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set &recheck); - bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set &recheck); + // FIXME: they are private so shouldn't affect abi, but just in case… + __deprecated bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set &recheck) { return true; }; + __deprecated bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set &recheck) { return true; }; + __deprecated bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set &recheck) { return true; }; + + + bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, + unsigned long const Depth, bool const FromUser); }; #endif