forked from openkylin/platform_build
Merge "Validates the config lists used by the script." am: a4ab1d8490
am: 0e58857364
am: d181c2119a
Change-Id: I597359107d78dccbb898e0897171e0876d4ddf79
This commit is contained in:
commit
113142152b
|
@ -204,6 +204,38 @@ def read_config_list(config_file_path):
|
||||||
return config_file.read().splitlines()
|
return config_file.read().splitlines()
|
||||||
|
|
||||||
|
|
||||||
|
def validate_config_lists(system_item_list, other_item_list):
|
||||||
|
"""Performs validations on the merge config lists.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
system_item_list: The list of items to extract from the partial
|
||||||
|
system target files package as is.
|
||||||
|
|
||||||
|
other_item_list: The list of items to extract from the partial
|
||||||
|
other target files package as is.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
False if a validation fails, otherwise true.
|
||||||
|
"""
|
||||||
|
default_combined_item_set = set(default_system_item_list)
|
||||||
|
default_combined_item_set.update(default_other_item_list)
|
||||||
|
|
||||||
|
combined_item_set = set(system_item_list)
|
||||||
|
combined_item_set.update(other_item_list)
|
||||||
|
|
||||||
|
# Check that the merge config lists are not missing any item specified
|
||||||
|
# by the default config lists.
|
||||||
|
difference = default_combined_item_set.difference(combined_item_set)
|
||||||
|
if difference:
|
||||||
|
logger.error('Missing merge config items: %s' % list(difference))
|
||||||
|
logger.error('Please ensure missing items are in either the '
|
||||||
|
'system-item-list or other-item-list files provided to '
|
||||||
|
'this script.')
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def process_ab_partitions_txt(
|
def process_ab_partitions_txt(
|
||||||
system_target_files_temp_dir,
|
system_target_files_temp_dir,
|
||||||
other_target_files_temp_dir,
|
other_target_files_temp_dir,
|
||||||
|
@ -683,6 +715,11 @@ def main():
|
||||||
else:
|
else:
|
||||||
other_item_list = default_other_item_list
|
other_item_list = default_other_item_list
|
||||||
|
|
||||||
|
if not validate_config_lists(
|
||||||
|
system_item_list=system_item_list,
|
||||||
|
other_item_list=other_item_list):
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
call_func_with_temp_dir(
|
call_func_with_temp_dir(
|
||||||
lambda temp_dir: merge_target_files(
|
lambda temp_dir: merge_target_files(
|
||||||
temp_dir=temp_dir,
|
temp_dir=temp_dir,
|
||||||
|
|
Loading…
Reference in New Issue