diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-09-04 14:56:01 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-09-04 14:56:01 +0200 |
commit | 85909fca550d03b0e215d16cdd701190b43ff63c (patch) | |
tree | b6767be7b1898830499b0a5fb8153460223b5649 /apt-pkg/aptconfiguration.cc | |
parent | ac5b5e826ab405935dc257c0a0984ae39b02bc23 (diff) | |
parent | 89e95aee05c7f2fde7eb11261df9697a4896b49b (diff) |
merged sftp://bzr.debian.org/bzr/apt/apt/debian-sid
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index d31ccb642..653775688 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -319,6 +319,17 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All, return codes; } /*}}}*/ +// checkLanguage - are we interested in the given Language? /*{{{*/ +bool const Configuration::checkLanguage(std::string Lang, bool const All) { + // the empty Language is always interesting as it is the original + if (Lang.empty() == true) + return true; + // filenames are encoded, so undo this + Lang = SubstVar(Lang, "%5f", "_"); + std::vector<std::string> const langs = getLanguages(All, true); + return (std::find(langs.begin(), langs.end(), Lang) != langs.end()); +} + /*}}}*/ // getArchitectures - Return Vector of prefered Architectures /*{{{*/ std::vector<std::string> const Configuration::getArchitectures(bool const &Cached) { using std::string; |