X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7852873a1347fcab50393b545cc1e6edd65531c8..2cc48828ea1a0ca0a0729c403abc9d7b25945880:/ftparchive/writer.cc diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 82049836a..27d6e98e0 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -56,7 +56,7 @@ FTWScanner *FTWScanner::Owner; // ConfigToDoHashes - which hashes to generate /*{{{*/ static void SingleConfigToDoHashes(unsigned int &DoHashes, std::string const &Conf, unsigned int const Flag) { - if (_config->FindB(Conf, true) == true) + if (_config->FindB(Conf, (DoHashes & Flag) == Flag) == true) DoHashes |= Flag; else DoHashes &= ~Flag; @@ -1020,7 +1020,7 @@ ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) : Fields["Architectures"] = ""; Fields["Components"] = ""; Fields["Description"] = ""; - if (_config->FindB("APT::FTPArchive::DoByHash", true) == true) + if (_config->FindB("APT::FTPArchive::DoByHash", false) == true) Fields["Acquire-By-Hash"] = "true"; for(map::const_iterator I = Fields.begin(); @@ -1076,7 +1076,7 @@ bool ReleaseWriter::DoPackage(string FileName) // FIXME: wrong layer in the code(?) // FIXME2: symlink instead of create a copy - if (_config->FindB("APT::FTPArchive::DoByHash", true) == true) + if (_config->FindB("APT::FTPArchive::DoByHash", false) == true) { std::string Input = FileName; HashStringList hsl = hs.GetHashStringList(); @@ -1085,8 +1085,10 @@ bool ReleaseWriter::DoPackage(string FileName) { if (!h->usable()) continue; - std::string ByHashOutputFile = GenByHashFilename(Input, *h); + if (flNotDir(FileName) == "Release" || flNotDir(FileName) == "InRelease") + continue; + std::string ByHashOutputFile = GenByHashFilename(Input, *h); std::string ByHashOutputDir = flNotFile(ByHashOutputFile); if(!CreateDirectory(flNotFile(Input), ByHashOutputDir)) return _error->Warning("can not create dir %s", flNotFile(ByHashOutputFile).c_str()); @@ -1139,7 +1141,7 @@ void ReleaseWriter::Finish() // go by-hash cleanup map::const_iterator prev = CheckSums.begin(); - if (_config->FindB("APT::FTPArchive::DoByHash", true) == true) + if (_config->FindB("APT::FTPArchive::DoByHash", false) == true) { for(map::const_iterator I = CheckSums.begin(); I != CheckSums.end(); ++I)