From 42ab8287546bc07217039643e4e277f1242c17a5 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Thu, 17 Feb 2022 13:07:55 -0800 Subject: [PATCH] Emit warning when build.prop import can't be resolved Some mountpoints are only available at device runtime, so ignore import failures in release tools. Bug: 214322896 Test: th Change-Id: I1e8c4fb08c6b825fa19c0f0e019dfaf2b03f2927 --- tools/releasetools/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index f4f9178dbb..560f3a7860 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -1025,7 +1025,8 @@ class PartitionBuildProps(object): import_path = tokens[1] if not re.match(r'^/{}/.*\.prop$'.format(self.partition), import_path): - raise ValueError('Unrecognized import path {}'.format(line)) + logger.warn('Unrecognized import path {}'.format(line)) + return {} # We only recognize a subset of import statement that the init process # supports. And we can loose the restriction based on how the dynamic