summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-08-26 00:51:12 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2016-08-26 00:51:12 -0700
commit1acc78fbd43e2ba8abe85b8c4cc6a73e360eb936 (patch)
tree64c79ae749629e797f34a62c0617738f319a6f7a
parent7d19f8ddf973511a88eb37133ace1d445363c1a9 (diff)
downloadldid-1acc78fbd43e2ba8abe85b8c4cc6a73e360eb936.tar.gz
ldid-1acc78fbd43e2ba8abe85b8c4cc6a73e360eb936.tar.zst
ldid-1acc78fbd43e2ba8abe85b8c4cc6a73e360eb936.zip
Only exclude nested files when bundles are nested.
-rw-r--r--ldid.cpp12
1 files changed, 8 insertions, 4 deletions
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<std::string ()> &read) {
}));
- std::map<std::string, std::string> links;
+ std::set<std::string> 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<std::string, std::string> links;
+
folder.Find("", fun([&](const std::string &name, const Functor<void (const Functor<void (std::streambuf &, std::streambuf &)> &)> &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());