1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

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.
This commit is contained in:
Hans-Christoph Steiner 2020-08-04 17:20:55 +02:00
parent 838eee355f
commit 54257f8f6a

View File

@ -211,12 +211,10 @@ def main():
opensc_so = '/usr/lib/opensc-pkcs11.so' opensc_so = '/usr/lib/opensc-pkcs11.so'
logging.warning('No OpenSC PKCS#11 module found, ' logging.warning('No OpenSC PKCS#11 module found, '
+ 'install OpenSC then edit "opensc-fdroid.cfg"!') + '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: 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): elif os.path.exists(keystore):
to_set = ['keystorepass', 'keypass', 'repo_keyalias', 'keydname'] to_set = ['keystorepass', 'keypass', 'repo_keyalias', 'keydname']
if repo_keyalias: if repo_keyalias: