From 2c085486d34c45e123c24b0e36294245fd5bf734 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 3 Dec 2010 17:06:34 +0100 Subject: * apt-pkg/depcache.cc: - add SetCandidateRelease() to set a candidate version and the candidates of dependencies if needed to a specified release (Closes: #572709) - change pkg/release behavior to use the new SetCandidateRelease so installing packages from experimental or backports is easier --- apt-pkg/depcache.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 2d3dbdf77..dba3e22dc 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -396,6 +396,25 @@ class pkgDepCache : protected pkgCache::Namespace void SetReInstall(PkgIterator const &Pkg,bool To); 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); -- cgit v1.2.3