]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/aptconfiguration.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 9 Jun 2012 22:40:55 +0000 (00:40 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 9 Jun 2012 22:40:55 +0000 (00:40 +0200)
  - if APT::Languages=none save "none" in allCodes so that the detected
    configuration is cached as intended (Closes: #674690, LP: #1004947)

apt-pkg/aptconfiguration.cc
debian/changelog
test/libapt/getlanguages_test.cc

index d763546f85b464f6387caf49981d914c54faebb3..d31ccb642e6ee202d731a33e14b2516d2ea955aa 100644 (file)
@@ -234,17 +234,21 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
        // override the configuration settings vector of languages.
        string const forceLang = _config->Find("Acquire::Languages","");
        if (forceLang.empty() == false) {
-               if (forceLang == "environment") {
-                       codes = environment;
-               } else if (forceLang != "none")
-                       codes.push_back(forceLang);
-               else //if (forceLang == "none")
-                       builtin.clear();
-               allCodes = codes;
-               for (std::vector<string>::const_iterator b = builtin.begin();
-                    b != builtin.end(); ++b)
-                       if (std::find(allCodes.begin(), allCodes.end(), *b) == allCodes.end())
-                               allCodes.push_back(*b);
+               if (forceLang == "none") {
+                       codes.clear();
+                       allCodes.clear();
+                       allCodes.push_back("none");
+               } else {
+                       if (forceLang == "environment")
+                               codes = environment;
+                       else
+                               codes.push_back(forceLang);
+                       allCodes = codes;
+                       for (std::vector<string>::const_iterator b = builtin.begin();
+                            b != builtin.end(); ++b)
+                               if (std::find(allCodes.begin(), allCodes.end(), *b) == allCodes.end())
+                                       allCodes.push_back(*b);
+               }
                if (All == true)
                        return allCodes;
                else
index d8adba89aeb71f20a8a873bdfa335d73eccef019..adcf0d956927cd37e33ee60ddfc822836e257427 100644 (file)
@@ -32,6 +32,9 @@ apt (0.9.5.2) UNRELEASED; urgency=low
     - set pkgCacheGen::Essential to "all" again (Closes: #675449)
   * apt-pkg/algorithms.cc:
     - force install only for one essential package out of a group
+  * apt-pkg/aptconfiguration.cc:
+    - if APT::Languages=none save "none" in allCodes so that the detected
+      configuration is cached as intended (Closes: #674690, LP: #1004947)
 
   [ Justin B Rye ]
   * doc/apt-cdrom.8.xml:
index 274cf4aa400c95662e5fc621f37f4b77c4969a69..cef89bde6583d574f6f55fc0826f879348b87cfb 100644 (file)
@@ -144,7 +144,8 @@ int main(int argc,char *argv[])
 
        _config->Set("Acquire::Languages", "none");
        vec = APT::Configuration::getLanguages(true, false, env);
-       equals(vec.size(), 0);
+       equals(vec.size(), 1);
+       equals(vec[0], "none");
        _config->Set("Acquire::Languages", "");
 
        _config->Set("Dir::State::lists", "/non-existing-dir");
@@ -168,7 +169,8 @@ int main(int argc,char *argv[])
        _config->Set("Acquire::Languages", "none");
        env[0] = "de_DE.UTF-8";
        vec = APT::Configuration::getLanguages(true, false, env);
-       equals(vec.size(), 0);
+       equals(vec.size(), 1);
+       equals(vec[0], "none");
 
        _config->Set("Acquire::Languages", "");
        //FIXME: Remove support for this deprecated setting