chiark / gitweb /
Only report files that were actually cleaned of signing stuff
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 22 Jun 2014 19:34:14 +0000 (21:34 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 22 Jun 2014 19:34:14 +0000 (21:34 +0200)
fdroidserver/common.py

index 32a924b5200664cd73aef5b555c076e6cc35566c..76883f0f160b10a6e0d8a44fee1a1bd2fa285e96 100644 (file)
@@ -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):