chiark / gitweb /
Gradle cleaner: support multilines with backslashes
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 5 Jan 2015 11:59:33 +0000 (12:59 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 5 Jan 2015 11:59:33 +0000 (12:59 +0100)
fdroidserver/common.py

index 775f69ae3100406daf5045fd79b76757d38046a5..41edee71f9cf339fed79a859093fba026cefd1c9 100644 (file)
@@ -1740,8 +1740,15 @@ def remove_signing_keys(build_dir):
             changed = False
 
             opened = 0
+            i = 0
             with open(path, "w") as o:
-                for line in lines:
+                while i < len(lines):
+                    line = lines[i]
+                    i += 1
+                    while line.endswith('\\\n'):
+                        line = line.rstrip('\\\n') + lines[i]
+                        i += 1
+
                     if comment.match(line):
                         continue