diff options
author | Jeff Sharkey <jsharkey@android.com> | 2014-03-18 17:20:10 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2014-03-21 13:22:54 -0700 |
commit | 26d22f713948dfc5292268b7307de7a3b9e22e4d (patch) | |
tree | 43067b7a3beb490a8c41ab6ea983b7242bd78165 /tools/post_process_props.py | |
parent | 9c2daa97e109b2c38789371d6eaa113277cab5ac (diff) | |
download | build-26d22f713948dfc5292268b7307de7a3b9e22e4d.zip build-26d22f713948dfc5292268b7307de7a3b9e22e4d.tar.gz build-26d22f713948dfc5292268b7307de7a3b9e22e4d.tar.bz2 |
Import OEM build properties, if defined.
Certain products can define a list of system properties that should be
delegated to the OEM. Since these properties may be ro.*, we give
them first shot at defining.
Also support blacklist of properties that should never be defined by
build.prop, used to delegate to runtime fingerprint generation.
Bug: 13367676
Change-Id: I3f00db732f485818205a7b76b31edbdc3a89aac0
Diffstat (limited to 'tools/post_process_props.py')
-rwxr-xr-x | tools/post_process_props.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/post_process_props.py b/tools/post_process_props.py index 5d1b350..a971683 100755 --- a/tools/post_process_props.py +++ b/tools/post_process_props.py @@ -16,6 +16,9 @@ import sys +# Usage: post_process_props.py file.prop [blacklist_key, ...] +# Blacklisted keys are removed from the property file, if present + # See PROP_VALUE_MAX system_properties.h. # PROP_VALUE_MAX in system_properties.h includes the termination NUL, # so we decrease it by 1 here. @@ -101,6 +104,10 @@ class PropFile: return self.lines.append(key + value) + def delete(self, name): + key = name + "=" + self.lines = [ line for line in self.lines if not line.startswith(key) ] + def write(self, f): f.write("\n".join(self.lines)) f.write("\n") @@ -124,6 +131,10 @@ def main(argv): if not validate(properties): sys.exit(1) + # Drop any blacklisted keys + for key in argv[2:]: + properties.delete(key) + f = open(filename, 'w+') properties.write(f) f.close() |