am f4bd044f: am d51b0fd3: Merge "Fail even dev build when property value exceeds length limit."
* commit 'f4bd044f09529430bdc9ac3cba083a39867dfab4': Fail even dev build when property value exceeds length limit.
This commit is contained in:
commit
18202932d1
|
@ -56,8 +56,6 @@ def validate(prop):
|
|||
"""
|
||||
check_pass = True
|
||||
buildprops = prop.to_dict()
|
||||
dev_build = buildprops.get("ro.build.version.incremental",
|
||||
"").startswith("eng")
|
||||
for key, value in buildprops.iteritems():
|
||||
# Check build properties' length.
|
||||
if len(key) > PROP_NAME_MAX:
|
||||
|
@ -66,19 +64,10 @@ def validate(prop):
|
|||
(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
|
||||
if dev_build:
|
||||
sys.stderr.write("warning: %s exceeds %d bytes: " %
|
||||
(key, PROP_VALUE_MAX))
|
||||
sys.stderr.write("%s (%d)\n" % (value, len(value)))
|
||||
sys.stderr.write("warning: This will cause the %s " % key)
|
||||
sys.stderr.write("property return as empty at runtime\n")
|
||||
else:
|
||||
check_pass = False
|
||||
sys.stderr.write("error: %s cannot exceed %d bytes: " %
|
||||
(key, PROP_VALUE_MAX))
|
||||
sys.stderr.write("%s (%d)\n" % (value, len(value)))
|
||||
check_pass = False
|
||||
sys.stderr.write("error: %s cannot exceed %d bytes: " %
|
||||
(key, PROP_VALUE_MAX))
|
||||
sys.stderr.write("%s (%d)\n" % (value, len(value)))
|
||||
return check_pass
|
||||
|
||||
class PropFile:
|
||||
|
|
Loading…
Reference in New Issue