Merge "Fix potential issues if str has spaces"
This commit is contained in:
@@ -557,7 +557,7 @@ def AddPartitionTable(output_zip):
|
|||||||
cmd = [bpttool, "make_table", "--output_json", bpt.name,
|
cmd = [bpttool, "make_table", "--output_json", bpt.name,
|
||||||
"--output_gpt", img.name]
|
"--output_gpt", img.name]
|
||||||
input_files_str = OPTIONS.info_dict["board_bpt_input_files"]
|
input_files_str = OPTIONS.info_dict["board_bpt_input_files"]
|
||||||
input_files = input_files_str.split(" ")
|
input_files = input_files_str.split()
|
||||||
for i in input_files:
|
for i in input_files:
|
||||||
cmd.extend(["--input", i])
|
cmd.extend(["--input", i])
|
||||||
disk_size = OPTIONS.info_dict.get("board_bpt_disk_size")
|
disk_size = OPTIONS.info_dict.get("board_bpt_disk_size")
|
||||||
|
@@ -1186,8 +1186,8 @@ def MergeDynamicPartitionInfoDicts(framework_dict, vendor_dict):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def uniq_concat(a, b):
|
def uniq_concat(a, b):
|
||||||
combined = set(a.split(" "))
|
combined = set(a.split())
|
||||||
combined.update(set(b.split(" ")))
|
combined.update(set(b.split()))
|
||||||
combined = [item.strip() for item in combined if item.strip()]
|
combined = [item.strip() for item in combined if item.strip()]
|
||||||
return " ".join(sorted(combined))
|
return " ".join(sorted(combined))
|
||||||
|
|
||||||
@@ -1208,7 +1208,7 @@ def MergeDynamicPartitionInfoDicts(framework_dict, vendor_dict):
|
|||||||
# Super block devices are defined by the vendor dict.
|
# Super block devices are defined by the vendor dict.
|
||||||
if "super_block_devices" in vendor_dict:
|
if "super_block_devices" in vendor_dict:
|
||||||
merged_dict["super_block_devices"] = vendor_dict["super_block_devices"]
|
merged_dict["super_block_devices"] = vendor_dict["super_block_devices"]
|
||||||
for block_device in merged_dict["super_block_devices"].split(" "):
|
for block_device in merged_dict["super_block_devices"].split():
|
||||||
key = "super_%s_device_size" % block_device
|
key = "super_%s_device_size" % block_device
|
||||||
if key not in vendor_dict:
|
if key not in vendor_dict:
|
||||||
raise ValueError("Vendor dict does not contain required key %s." % key)
|
raise ValueError("Vendor dict does not contain required key %s." % key)
|
||||||
@@ -1217,7 +1217,7 @@ def MergeDynamicPartitionInfoDicts(framework_dict, vendor_dict):
|
|||||||
# Partition groups and group sizes are defined by the vendor dict because
|
# Partition groups and group sizes are defined by the vendor dict because
|
||||||
# these values may vary for each board that uses a shared system image.
|
# these values may vary for each board that uses a shared system image.
|
||||||
merged_dict["super_partition_groups"] = vendor_dict["super_partition_groups"]
|
merged_dict["super_partition_groups"] = vendor_dict["super_partition_groups"]
|
||||||
for partition_group in merged_dict["super_partition_groups"].split(" "):
|
for partition_group in merged_dict["super_partition_groups"].split():
|
||||||
# Set the partition group's size using the value from the vendor dict.
|
# Set the partition group's size using the value from the vendor dict.
|
||||||
key = "super_%s_group_size" % partition_group
|
key = "super_%s_group_size" % partition_group
|
||||||
if key not in vendor_dict:
|
if key not in vendor_dict:
|
||||||
|
@@ -881,7 +881,7 @@ def RewriteProps(data):
|
|||||||
pieces[-1] = EditTags(pieces[-1])
|
pieces[-1] = EditTags(pieces[-1])
|
||||||
value = "/".join(pieces)
|
value = "/".join(pieces)
|
||||||
elif key == "ro.build.description":
|
elif key == "ro.build.description":
|
||||||
pieces = value.split(" ")
|
pieces = value.split()
|
||||||
assert pieces[-1].endswith("-keys")
|
assert pieces[-1].endswith("-keys")
|
||||||
pieces[-1] = EditTags(pieces[-1])
|
pieces[-1] = EditTags(pieces[-1])
|
||||||
value = " ".join(pieces)
|
value = " ".join(pieces)
|
||||||
@@ -1098,7 +1098,7 @@ def RewriteAvbProps(misc_info):
|
|||||||
|
|
||||||
tokens = []
|
tokens = []
|
||||||
changed = False
|
changed = False
|
||||||
for token in args.split(' '):
|
for token in args.split():
|
||||||
fingerprint_key = 'com.android.build.{}.fingerprint'.format(partition)
|
fingerprint_key = 'com.android.build.{}.fingerprint'.format(partition)
|
||||||
if not token.startswith(fingerprint_key):
|
if not token.startswith(fingerprint_key):
|
||||||
tokens.append(token)
|
tokens.append(token)
|
||||||
|
Reference in New Issue
Block a user