From 454358894184fcf19d77d713c6fab3e7fe8cea6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 16 Nov 2013 12:54:35 +0100 Subject: [PATCH] Fix keysigning patching (again) --- fdroidserver/common.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 195523f8..247c46fe 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1971,8 +1971,8 @@ def remove_signing_keys(build_dir): lines = o.readlines() opened = 0 - with open(path, "w+") as o: - for line in o: + with open(path, "w") as o: + for line in lines: if 'signingConfigs ' in line: opened = 1 changed = True @@ -1994,8 +1994,11 @@ def remove_signing_keys(build_dir): path = os.path.join(root, propfile) changed = False - with open(path, "w+") as o: - for line in o: + with open(path, "r") as o: + lines = o.readlines() + + with open(path, "w") as o: + for line in lines: if line.startswith('key.store'): changed = True else: