From 4a53151acad0c4ccfbcf4ce11c5c2d7cffd05de3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 16 Jul 2011 14:57:37 +0200 Subject: do not require unused partial dirs in 'source' (Closes: #633510) --- apt-pkg/acquire.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index e3a4435b8..9fe0e8a87 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -348,6 +348,8 @@ class pkgAcquire */ bool Setup(pkgAcquireStatus *Progress = NULL, string const &Lock = ""); + void SetLog(pkgAcquireStatus *Progress) { Log = Progress; } + /** \brief Construct a new pkgAcquire. */ pkgAcquire(pkgAcquireStatus *Log) __deprecated; pkgAcquire(); -- cgit v1.2.3 From a3bbbab7ca5f94391b2158cfe9deb85eb335e29a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 16 Jul 2011 16:48:03 +0200 Subject: * apt-pkg/policy.cc: - emit an error on unknown APT::Default-Release value (Closes: #407511) --- apt-pkg/policy.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index bd213e0ce..c5028d822 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -56,8 +56,22 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner) // The config file has a master override. string DefRel = _config->Find("APT::Default-Release"); if (DefRel.empty() == false) - CreatePin(pkgVersionMatch::Release,"",DefRel,990); - + { + bool found = false; + // FIXME: make ExpressionMatches static to use it here easily + pkgVersionMatch vm("", pkgVersionMatch::None); + for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F) + { + if ((F->Archive != 0 && vm.ExpressionMatches(DefRel, F.Archive()) == true) || + (F->Codename != 0 && vm.ExpressionMatches(DefRel, F.Codename()) == true) || + (F->Version != 0 && vm.ExpressionMatches(DefRel, F.Version()) == true)) + found = true; + } + if (found == false) + _error->Error(_("The value '%s' is invalid for APT::Default-Release as such a release is not available in the sources"), DefRel.c_str()); + else + CreatePin(pkgVersionMatch::Release,"",DefRel,990); + } InitDefaults(); } /*}}}*/ -- cgit v1.2.3