lineage_patches_unified/patches/platform_frameworks_base/0006-property-matching-RROs-allow-to-prefix-the-value-wit.patch
2020-10-29 03:02:26 +00:00

39 lines
1.3 KiB
Diff

From f3d0a467c4c1f9df19c3c4819b4c6cb4b26fe2a3 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 11 Sep 2020 23:42:37 +0200
Subject: [PATCH] property-matching RROs: allow to prefix the value with + to
do glob match instead of exact match
Change-Id: I1f5b7c907523eb6e48d41f5163984564d3db9506
---
cmds/idmap2/idmap2/Scan.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp
index 36250450cc7..6a5162dd0d9 100644
--- a/cmds/idmap2/idmap2/Scan.cpp
+++ b/cmds/idmap2/idmap2/Scan.cpp
@@ -15,6 +15,7 @@
*/
#include <dirent.h>
+#include <fnmatch.h>
#include <fstream>
#include <memory>
@@ -187,7 +188,10 @@ Result<Unit> Scan(const std::vector<std::string>& args) {
// if property set & equal to value, then include overlay - otherwise skip
if (android::base::GetProperty(overlay_info->requiredSystemPropertyName, "") !=
overlay_info->requiredSystemPropertyValue) {
- continue;
+ auto osValue = android::base::GetProperty(overlay_info->requiredSystemPropertyName, "");
+ if(fnmatch(overlay_info->requiredSystemPropertyValue.c_str()+1, osValue.c_str(), 0) != 0) {
+ continue;
+ }
}
}
--
2.25.1