From 1acc78fbd43e2ba8abe85b8c4cc6a73e360eb936 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 26 Aug 2016 00:51:12 -0700 Subject: Only exclude nested files when bundles are nested. --- ldid.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ldid.cpp') diff --git a/ldid.cpp b/ldid.cpp index 6b0c95a..7e4dd03 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -2096,7 +2096,7 @@ Bundle Sign(const std::string &root, Folder &folder, const std::string &key, std }), fun([&](const std::string &name, const Functor &read) { })); - std::map links; + std::set excludes; auto exclude([&](const std::string &name) { // BundleDiskRep::adjustResources -> builder.addExclusion @@ -2104,12 +2104,16 @@ Bundle Sign(const std::string &root, Folder &folder, const std::string &key, std return true; for (const auto &bundle : bundles) - if (Starts(name, bundle.first + "/")) + if (Starts(name, bundle.first + "/")) { + excludes.insert(name); return true; + } return false; }); + std::map links; + folder.Find("", fun([&](const std::string &name, const Functor &)> &code) { if (exclude(name)) return; @@ -2170,8 +2174,8 @@ Bundle Sign(const std::string &root, Folder &folder, const std::string &key, std for (const auto &hash : local) for (const auto &rule : version.second) if (rule(hash.first)) { - if (rule.mode_ == NestedMode); - else if (rule.mode_ == NoMode && old) + if (!old && mac && excludes.find(hash.first) != excludes.end()); + else if (old && rule.mode_ == NoMode) plist_dict_set_item(files, hash.first.c_str(), plist_new_data(hash.second.sha1_, sizeof(hash.second.sha1_))); else if (rule.mode_ != OmitMode) { auto entry(plist_new_dict()); -- cgit v1.2.3-56-ge451