]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.cc
restart debSrcRecordParsers only if needed
[apt.git] / apt-pkg / aptconfiguration.cc
index 4f9b84e0045905ca337af6754f1436a16368bfc6..1ebcf97bc5821408372c66ffc634d2d97e1c7200 100644 (file)
@@ -141,7 +141,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
        // so they will be all included in the Cache.
        std::vector<string> builtin;
        DIR *D = opendir(_config->FindDir("Dir::State::lists").c_str());
-       if (D != 0) {
+       if (D != NULL) {
                builtin.push_back("none");
                for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) {
                        string const name = SubstVar(Ent->d_name, "%5f", "_");
@@ -166,8 +166,8 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
                                continue;
                        builtin.push_back(c);
                }
+               closedir(D);
        }
-       closedir(D);
 
        // FIXME: Remove support for the old APT::Acquire::Translation
        // it was undocumented and so it should be not very widthly used
@@ -453,7 +453,7 @@ void Configuration::setDefaultConfigurationForCompressors() {
        _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
        _config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
        if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
-               _config->Clear("Dir::Bin::lzma");
+               _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");