]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.cc
Merge branch 'feature/extractar-filefd' into debian/experimental
[apt.git] / apt-pkg / aptconfiguration.cc
index 9982759c634d7cda87fc16df3d1e803925395114..f5bc18394ef5f38f4f52692229c204bc13407fca 100644 (file)
 #include <string>
 #include <vector>
 
-#include <apti18n.h>
                                                                        /*}}}*/
 namespace APT {
+// setDefaultConfigurationForCompressors                               /*{{{*/
+static void setDefaultConfigurationForCompressors() {
+       // Set default application paths to check for optional compression types
+       _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
+       _config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
+       if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
+               _config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
+               _config->Set("APT::Compressor::lzma::Binary", "xz");
+               if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
+                       _config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
+                       _config->Set("APT::Compressor::lzma::CompressArg::", "-9");
+               }
+               if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
+                       _config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma");
+                       _config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
+               }
+       } else {
+               _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
+               if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
+                       _config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
+                       _config->Set("APT::Compressor::lzma::CompressArg::", "-9");
+               }
+               if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
+                       _config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix=");
+                       _config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
+               }
+       }
+}
+                                                                       /*}}}*/
 // getCompressionTypes - Return Vector of usable compressiontypes      /*{{{*/
 // ---------------------------------------------------------------------
 /* return a vector of compression types in the preferred order. */
@@ -193,7 +221,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
        // get the environment language codes: LC_MESSAGES (and later LANGUAGE)
        // we extract both, a long and a short code and then we will
        // check if we actually need both (rare) or if the short is enough
-       string const envMsg = string(Locale == 0 ? std::setlocale(LC_MESSAGES, NULL) : *Locale);
+       string const envMsg = string(Locale == 0 ? ::setlocale(LC_MESSAGES, NULL) : *Locale);
        size_t const lenShort = (envMsg.find('_') != string::npos) ? envMsg.find('_') : 2;
        size_t const lenLong = (envMsg.find_first_of(".@") != string::npos) ? envMsg.find_first_of(".@") : (lenShort + 3);
 
@@ -402,35 +430,6 @@ bool Configuration::checkArchitecture(std::string const &Arch) {
        return (std::find(archs.begin(), archs.end(), Arch) != archs.end());
 }
                                                                        /*}}}*/
-// setDefaultConfigurationForCompressors                               /*{{{*/
-void Configuration::setDefaultConfigurationForCompressors() {
-       // Set default application paths to check for optional compression types
-       _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
-       _config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
-       if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
-               _config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
-               _config->Set("APT::Compressor::lzma::Binary", "xz");
-               if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
-                       _config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
-                       _config->Set("APT::Compressor::lzma::CompressArg::", "-9");
-               }
-               if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
-                       _config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma");
-                       _config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
-               }
-       } else {
-               _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
-               if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
-                       _config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
-                       _config->Set("APT::Compressor::lzma::CompressArg::", "-9");
-               }
-               if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
-                       _config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix=");
-                       _config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
-               }
-       }
-}
-                                                                       /*}}}*/
 // getCompressors - Return Vector of usealbe compressors               /*{{{*/
 // ---------------------------------------------------------------------
 /* return a vector of compressors used by apt-ftparchive in the
@@ -540,7 +539,7 @@ std::string const Configuration::getBuildProfilesString() {
                return "";
        std::vector<std::string>::const_iterator p = profiles.begin();
        std::string list = *p;
-       for (; p != profiles.end(); ++p)
+       for (++p; p != profiles.end(); ++p)
           list.append(",").append(*p);
        return list;
 }