diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-09-04 14:49:41 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-09-04 14:49:41 +0200 |
commit | 89e95aee05c7f2fde7eb11261df9697a4896b49b (patch) | |
tree | 51ab3d569d8ab1c8d3b25de1452eeb767770e0e7 /apt-pkg/aptconfiguration.cc | |
parent | d7bc74a4e44c4ff97e70f15e19f86761687f2ca5 (diff) | |
parent | 92f212774bebbff6aabd3081910f570a77180911 (diff) |
merged lp:~donkult/apt/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; |