From 26154127e6fb2d63f55ed91e49056e8c6778627c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Sun, 22 Jun 2014 21:34:14 +0200 Subject: [PATCH] Only report files that were actually cleaned of signing stuff --- fdroidserver/common.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 32a924b5..76883f0f 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1632,6 +1632,8 @@ def remove_signing_keys(build_dir): with open(path, "r") as o: lines = o.readlines() + changed = False + opened = 0 with open(path, "w") as o: for line in lines: @@ -1644,16 +1646,19 @@ def remove_signing_keys(build_dir): continue if signing_configs.match(line): + changed = True opened += 1 continue if any(s.match(line) for s in line_matches): + changed = True continue if opened == 0: o.write(line) - logging.info("Cleaned build.gradle of keysigning configs at %s" % path) + if changed: + logging.info("Cleaned build.gradle of keysigning configs at %s" % path) for propfile in [ 'project.properties', @@ -1667,15 +1672,18 @@ def remove_signing_keys(build_dir): with open(path, "r") as o: lines = o.readlines() + changed = False + with open(path, "w") as o: for line in lines: - if line.startswith('key.store'): - continue - if line.startswith('key.alias'): + if any(line.startswith(s) for s in ('key.store', 'key.alias')): + changed = True continue + o.write(line) - logging.info("Cleaned %s of keysigning configs at %s" % (propfile, path)) + if changed: + logging.info("Cleaned %s of keysigning configs at %s" % (propfile, path)) def replace_config_vars(cmd): -- 2.30.2