]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/aptconfiguration.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 5 Apr 2012 16:49:13 +0000 (18:49 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 5 Apr 2012 16:49:13 +0000 (18:49 +0200)
  - if present, prefer xz binary over lzma

apt-pkg/aptconfiguration.cc
debian/changelog

index 4324f0e6395e60fcba7d728658bc9931862d1156..2fdb837c58087c05c9a5eab0a3f2f02a24eace29 100644 (file)
@@ -432,9 +432,30 @@ bool const Configuration::checkArchitecture(std::string const &Arch) {
 // setDefaultConfigurationForCompressors                               /*{{{*/
 void Configuration::setDefaultConfigurationForCompressors() {
        // Set default application paths to check for optional compression types
-       _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
-       _config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
        _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
+       _config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
+       if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
+               _config->CndSet("Dir::Bin::lzma", _config->Find("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 usbale compressors                        /*{{{*/
@@ -458,10 +479,10 @@ const Configuration::getCompressors(bool const Cached) {
                compressors.push_back(Compressor("gzip",".gz","gzip","-9n","-d",2));
        if (_config->Exists("Dir::Bin::bzip2") == false || FileExists(_config->FindFile("Dir::Bin::bzip2")) == true)
                compressors.push_back(Compressor("bzip2",".bz2","bzip2","-9","-d",3));
-       if (_config->Exists("Dir::Bin::lzma") == false || FileExists(_config->FindFile("Dir::Bin::lzma")) == true)
-               compressors.push_back(Compressor("lzma",".lzma","lzma","-9","-d",4));
        if (_config->Exists("Dir::Bin::xz") == false || FileExists(_config->FindFile("Dir::Bin::xz")) == true)
-               compressors.push_back(Compressor("xz",".xz","xz","-6","-d",5));
+               compressors.push_back(Compressor("xz",".xz","xz","-6","-d",4));
+       if (_config->Exists("Dir::Bin::lzma") == false || FileExists(_config->FindFile("Dir::Bin::lzma")) == true)
+               compressors.push_back(Compressor("lzma",".lzma","lzma","-9","-d",5));
 
        std::vector<std::string> const comp = _config->FindVector("APT::Compressor");
        for (std::vector<std::string>::const_iterator c = comp.begin();
@@ -494,7 +515,7 @@ Configuration::Compressor::Compressor(char const *name, char const *extension,
                                      char const *binary,
                                      char const *compressArg, char const *uncompressArg,
                                      unsigned short const cost) {
-       std::string const config = std::string("APT:Compressor::").append(name).append("::");
+       std::string const config = std::string("APT::Compressor::").append(name).append("::");
        Name = _config->Find(std::string(config).append("Name"), name);
        Extension = _config->Find(std::string(config).append("Extension"), extension);
        Binary = _config->Find(std::string(config).append("Binary"), binary);
index fe92378dd72d3e47da0dd185f2bdac1914de4b18..631a8d2d22c157d17b17dca30ee55ee9e31794d6 100644 (file)
@@ -59,6 +59,8 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low
     - move the command synopsis out of each manpage into apt-verbatim.ent
       as they are a hell to translate and just single out the parameters
       which can be translated to apt.ent
+  * apt-pkg/aptconfiguration.cc:
+    - if present, prefer xz binary over lzma
 
   [ Bogdan Purcareata ]
   * doc/apt-get.8.xml:
@@ -68,7 +70,7 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low
       number of auto-removed packages both before and after the list
       of packages (Closes: #665833)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 05 Apr 2012 11:55:30 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 05 Apr 2012 18:39:51 +0200
 
 apt (0.8.16~exp13) experimental; urgency=low