From ace33bcfc09386f18241be81f05d29dddc039711 Mon Sep 17 00:00:00 2001 From: Cyril Russo Date: Fri, 17 Aug 2018 16:46:46 +0200 Subject: [PATCH] Reverted the change in the default config.py Improved the detection of keytool and jarsigner by also searching the PATH environment variable --- examples/config.py | 3 --- fdroidserver/common.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/config.py b/examples/config.py index 180b1cee..7e2be2e4 100644 --- a/examples/config.py +++ b/examples/config.py @@ -118,9 +118,6 @@ 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 f0d0abae..49a6950b 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -236,6 +236,18 @@ def fill_config_defaults(thisconfig): thisconfig['keytool'] = os.path.join(java_home, 'bin', 'keytool') break + if 'jarsigner' not in thisconfig: + for path in os.environ['PATH'].split(':'): + jarsigner = os.path.join(path, 'jarsigner') + if os.path.exists(jarsigner): + thisconfig['jarsigner'] = jarsigner + else: + continue + keytool = os.path.join(path, 'keytool') + if os.path.exists(keytool): + thisconfig['keytool'] = keytool + break + for k in ['ndk_paths', 'java_paths']: d = thisconfig[k] for k2 in d.copy():