summaryrefslogtreecommitdiffstats
path: root/tools/post_process_props.py
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-07-30 09:53:12 -0700
committerBrian Carlstrom <bdc@google.com>2014-07-30 09:53:12 -0700
commit4a5a11e416425689d9f37a1963ae852051b451d2 (patch)
tree717eecd5acdbdf3fa8f15ac5a2dcecc853be7276 /tools/post_process_props.py
parent1dd586eea2ef7fb14cf212dea327b2f344877363 (diff)
parenta8138028470048fadb0ecd97c58c83a045875943 (diff)
downloadbuild-4a5a11e416425689d9f37a1963ae852051b451d2.zip
build-4a5a11e416425689d9f37a1963ae852051b451d2.tar.gz
build-4a5a11e416425689d9f37a1963ae852051b451d2.tar.bz2
resolved conflicts for merge of a8138028 to lmp-dev-plus-aosp
Change-Id: I5573d097d741f4922b791b33de5c941af08127c6
Diffstat (limited to 'tools/post_process_props.py')
-rwxr-xr-xtools/post_process_props.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/post_process_props.py b/tools/post_process_props.py
index e43ca59..030826d 100755
--- a/tools/post_process_props.py
+++ b/tools/post_process_props.py
@@ -19,9 +19,10 @@ 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.
+# See PROP_NAME_MAX and PROP_VALUE_MAX system_properties.h.
+# The constants in system_properties.h includes the termination NUL,
+# so we decrease the values by 1 here.
+PROP_NAME_MAX = 31
PROP_VALUE_MAX = 91
# Put the modifications that you need to make into the /system/build.prop into this
@@ -59,6 +60,11 @@ def validate(prop):
"").startswith("eng")
for key, value in buildprops.iteritems():
# Check build properties' length.
+ if len(key) > PROP_NAME_MAX:
+ check_pass = False
+ sys.stderr.write("error: %s cannot exceed %d bytes: " %
+ (key, PROP_NAME_MAX))
+ sys.stderr.write("%s (%d)\n" % (key, len(key)))
if len(value) > PROP_VALUE_MAX:
# If dev build, show a warning message, otherwise fail the
# build with error message