Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38df1013 authored by Ying Wang's avatar Ying Wang
Browse files

Fail even dev build when property value exceeds length limit.

Let developers know the issue earlier when they set up new
products.

Change-Id: I3f2ecbc3a833c1a8a84bd75407a5c035e5fea70a
parent 4c178ebc
Loading
Loading
Loading
Loading
+4 −15
Original line number Diff line number Diff line
@@ -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,15 +64,6 @@ 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))