From 54257f8f6a5130333a589d31d41df840c155ec86 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 4 Aug 2020 17:20:55 +0200 Subject: [PATCH] init: generate opensc-fdroid.cfg rather than copying from examples This file is so simple, it is better to skip the complexity of trying to find the installed examples folder, especially when considering Windows and macOS, with their odd paths. --- fdroidserver/init.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fdroidserver/init.py b/fdroidserver/init.py index 280a503a..c0c23207 100644 --- a/fdroidserver/init.py +++ b/fdroidserver/init.py @@ -211,12 +211,10 @@ def main(): opensc_so = '/usr/lib/opensc-pkcs11.so' logging.warning('No OpenSC PKCS#11 module found, ' + 'install OpenSC then edit "opensc-fdroid.cfg"!') - with open(os.path.join(examplesdir, 'opensc-fdroid.cfg'), 'r') as f: - opensc_fdroid = f.read() - opensc_fdroid = re.sub('^library.*', 'library = ' + opensc_so, opensc_fdroid, - flags=re.MULTILINE) with open('opensc-fdroid.cfg', 'w') as f: - f.write(opensc_fdroid) + f.write('name = OpenSC\nlibrary = ') + f.write(opensc_so) + f.write('\n') elif os.path.exists(keystore): to_set = ['keystorepass', 'keypass', 'repo_keyalias', 'keydname'] if repo_keyalias: