[Buildroot] [PATCH 13/19] support/check-uniq-file: invert condition logic

Yann E. MORIN yann.morin.1998 at free.fr
Mon Jan 7 22:05:35 UTC 2019


We currently have a single condition to test for to decide whether a
file should be reported or not, but in the future we're going to add
more conditions.

Invert the logic so that we can easily add such checks.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 support/scripts/check-uniq-files | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/support/scripts/check-uniq-files b/support/scripts/check-uniq-files
index 7020462981..cf9ea292bc 100755
--- a/support/scripts/check-uniq-files
+++ b/support/scripts/check-uniq-files
@@ -40,10 +40,12 @@ def main():
         file_to_pkg[record['file']].add(record['pkg'])
 
     for file in file_to_pkg:
-        if len(file_to_pkg[file]) > 1:
-            sys.stderr.write(warn.format(args.type, str_decode(file),
-                                         ", ".join([str_decode(p)
-                                                    for p in file_to_pkg[file]])))
+        if len(file_to_pkg[file]) == 1:
+            continue
+
+        sys.stderr.write(warn.format(args.type, str_decode(file),
+                                     ", ".join([str_decode(p)
+                                                for p in file_to_pkg[file]])))
 
 
 if __name__ == "__main__":
-- 
2.14.1



More information about the buildroot mailing list