From f5d8193c4603585a4f838ddd2c66e2b716869cc6 Mon Sep 17 00:00:00 2001 From: Daniel Norman Date: Fri, 28 Feb 2020 11:51:59 -0800 Subject: [PATCH] Adds official comment support to the whitelist format. Test: Added a comment to the whitelist.txt, ran compare_images. Change-Id: I27a8949b13dd55d23cbb6fd5a3b68ecdcb7204b2 --- vndk/tools/image-diff-tool/diff.py | 4 ++++ vndk/tools/image-diff-tool/whitelist.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/vndk/tools/image-diff-tool/diff.py b/vndk/tools/image-diff-tool/diff.py index ff3b0ae6b..9bce1742c 100644 --- a/vndk/tools/image-diff-tool/diff.py +++ b/vndk/tools/image-diff-tool/diff.py @@ -65,6 +65,8 @@ def make_filter_from_whitelists(whitelists, all_targets): Whitelist can contain pathname patterns or ignored lines. Pathnames are case insensitive. + Whitelist can contain single-line comments. Comment lines begin with # + For example, this ignores the file "system/build.prop": SYSTEM/build.prop @@ -93,6 +95,8 @@ def make_filter_from_whitelists(whitelists, all_targets): with open(whitelist, 'rb') as f: for line in f: pat = line.strip().decode() + if pat.startswith('#'): + continue if pat and pat[-1] == '\\': pat = pat.rstrip('\\') if '=' in pat: diff --git a/vndk/tools/image-diff-tool/whitelist.txt b/vndk/tools/image-diff-tool/whitelist.txt index 569804c79..87efe8ae9 100644 --- a/vndk/tools/image-diff-tool/whitelist.txt +++ b/vndk/tools/image-diff-tool/whitelist.txt @@ -1,3 +1,4 @@ +# Common whitelist system/build.prop=ro.system.build.date system/build.prop=ro.system.build.fingerprint system/build.prop=ro.system.build.version.incremental