Only report files that were actually cleaned of signing stuff

This commit is contained in:
Daniel Martí 2014-06-22 21:34:14 +02:00
parent 7c2e61a407
commit 26154127e6

View file

@ -1632,6 +1632,8 @@ def remove_signing_keys(build_dir):
with open(path, "r") as o: with open(path, "r") as o:
lines = o.readlines() lines = o.readlines()
changed = False
opened = 0 opened = 0
with open(path, "w") as o: with open(path, "w") as o:
for line in lines: for line in lines:
@ -1644,15 +1646,18 @@ def remove_signing_keys(build_dir):
continue continue
if signing_configs.match(line): if signing_configs.match(line):
changed = True
opened += 1 opened += 1
continue continue
if any(s.match(line) for s in line_matches): if any(s.match(line) for s in line_matches):
changed = True
continue continue
if opened == 0: if opened == 0:
o.write(line) o.write(line)
if changed:
logging.info("Cleaned build.gradle of keysigning configs at %s" % path) logging.info("Cleaned build.gradle of keysigning configs at %s" % path)
for propfile in [ for propfile in [
@ -1667,14 +1672,17 @@ def remove_signing_keys(build_dir):
with open(path, "r") as o: with open(path, "r") as o:
lines = o.readlines() lines = o.readlines()
changed = False
with open(path, "w") as o: with open(path, "w") as o:
for line in lines: for line in lines:
if line.startswith('key.store'): if any(line.startswith(s) for s in ('key.store', 'key.alias')):
continue changed = True
if line.startswith('key.alias'):
continue continue
o.write(line) o.write(line)
if changed:
logging.info("Cleaned %s of keysigning configs at %s" % (propfile, path)) logging.info("Cleaned %s of keysigning configs at %s" % (propfile, path))