From 3bdbd34b9a57d6880af2968654bb73b3f0208b0f Mon Sep 17 00:00:00 2001 From: Bill Peckham Date: Wed, 21 Oct 2020 15:49:54 -0700 Subject: [PATCH] Include 'name' in props; use post-sanitize module name. In cases where not all the variants of a library are included in the generated vendor snapshot, be sure to include the module name in the props so that it can be factored out later. Conversely, be sure to compute the notice filename from the de-sanitized module name so so that it can also be factored out later. Bug: 171413810 Bug: 157967325 Test: Verify that full snapshot Android.bp unchanged. Test: Verify correct syntax for filtered snapshot. Change-Id: I5725e17b19907d6a5063823e8b99bd0517c7c144 --- vendor_snapshot/update.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vendor_snapshot/update.py b/vendor_snapshot/update.py index b71a12fa1..318318e7e 100644 --- a/vendor_snapshot/update.py +++ b/vendor_snapshot/update.py @@ -241,9 +241,6 @@ def build_props(install_dir): target_arch) module_name = prop['name'] - notice_path = 'NOTICE_FILES/' + module_name + '.txt' - if os.path.exists(os.path.join(bp_dir, notice_path)): - prop['notice'] = notice_path # Is this sanitized variant? if 'sanitize' in prop: @@ -254,7 +251,11 @@ def build_props(install_dir): for k in list(prop.keys()): if not k in SANITIZER_VARIANT_PROPS: del prop[k] - prop = {sanitizer_type: prop} + prop = {'name': module_name, sanitizer_type: prop} + + notice_path = 'NOTICE_FILES/' + module_name + '.txt' + if os.path.exists(os.path.join(bp_dir, notice_path)): + prop['notice'] = notice_path variation_dict = props[target_arch][variation] if not module_name in variation_dict: