From 4f21045cadc0a83065fe07b2bc8554b29b5cc390 Mon Sep 17 00:00:00 2001 From: Cyril Russo Date: Fri, 17 Aug 2018 15:32:29 +0200 Subject: [PATCH] Fix keytool not found on MacOSX (when using Java from Apple) Fix keytool parsing error due to localisation keytool -list command. Always fallback to english so the parsing makes sense. --- examples/config.py | 3 +++ fdroidserver/common.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/config.py b/examples/config.py index 7e2be2e4..180b1cee 100644 --- a/examples/config.py +++ b/examples/config.py @@ -118,6 +118,9 @@ The repository of older versions of applications from the main demo repository. # keystore. # repo_pubkey = "..." +# The keytool command to run to get Java's keytool version +keytool = "keytool" + # The keystore to use for release keys when building. This needs to be # somewhere safe and secure, and backed up! The best way to manage these # sensitive keys is to use a "smartcard" (aka Hardware Security Module). To diff --git a/fdroidserver/common.py b/fdroidserver/common.py index f3c277dc..f0d0abae 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -2907,7 +2907,8 @@ def genkeystore(localconfig): '-validity', '10000', '-storepass:env', 'FDROID_KEY_STORE_PASS', '-keypass:env', 'FDROID_KEY_PASS', - '-dname', localconfig['keydname']], envs=env_vars) + '-dname', localconfig['keydname'], + '-J-Duser.language=en'], envs=env_vars) if p.returncode != 0: raise BuildException("Failed to generate key", p.output) os.chmod(localconfig['keystore'], 0o0600) @@ -2916,7 +2917,7 @@ def genkeystore(localconfig): p = FDroidPopen([config['keytool'], '-list', '-v', '-keystore', localconfig['keystore'], '-alias', localconfig['repo_keyalias'], - '-storepass:env', 'FDROID_KEY_STORE_PASS'], envs=env_vars) + '-storepass:env', 'FDROID_KEY_STORE_PASS', '-J-Duser.language=en'], envs=env_vars) logging.info(p.output.strip() + '\n\n') # get the public key p = FDroidPopenBytes([config['keytool'], '-exportcert',