chiark / gitweb /
Set the FDroidOpen output default back to true
[fdroidserver.git] / fdroidserver / common.py
index 5db9f5403d28c0d908be418ab9e1c5ea0629006a..32a924b5200664cd73aef5b555c076e6cc35566c 100644 (file)
@@ -92,6 +92,11 @@ def read_config(opts, config_file='config.py'):
                                       'sun.security.pkcs11.SunPKCS11',
                                       '-providerArg', 'opensc-fdroid.cfg']
 
+    if any(k in config for k in ["keystore", "keystorepass", "keypass"]):
+        st = os.stat(config_file)
+        if st.st_mode & stat.S_IRWXG or st.st_mode & stat.S_IRWXO:
+            logging.warn("unsafe permissions on {0} (should be 0600)!".format(config_file))
+
     defconfig = get_default_config()
     for k, v in defconfig.items():
         if k not in config:
@@ -107,11 +112,6 @@ def read_config(opts, config_file='config.py'):
     if not test_sdk_exists(config):
         sys.exit(3)
 
-    if any(k in config for k in ["keystore", "keystorepass", "keypass"]):
-        st = os.stat(config_file)
-        if st.st_mode & stat.S_IRWXG or st.st_mode & stat.S_IRWXO:
-            logging.warn("unsafe permissions on {0} (should be 0600)!".format(config_file))
-
     for k in ["keystorepass", "keypass"]:
         if k in config:
             write_password_file(k)
@@ -893,15 +893,21 @@ def parse_androidmanifests(paths, ignoreversions=None):
                 if matches:
                     vercode = matches.group(1)
 
-        # Better some package name than nothing
-        if max_package is None:
+        # Always grab the package name and version name in case they are not
+        # together with the highest version code
+        if max_package is None and package is not None:
             max_package = package
+        if max_version is None and version is not None:
+            max_version = version
 
         if max_vercode is None or (vercode is not None and vercode > max_vercode):
             if not ignoresearch or not ignoresearch(version):
-                max_version = version
-                max_vercode = vercode
-                max_package = package
+                if version is not None:
+                    max_version = version
+                if vercode is not None:
+                    max_vercode = vercode
+                if package is not None:
+                    max_package = package
             else:
                 max_version = "Ignore"
 
@@ -1570,7 +1576,7 @@ def SilentPopen(commands, cwd=None, shell=False):
     return FDroidPopen(commands, cwd=cwd, shell=shell, output=False)
 
 
-def FDroidPopen(commands, cwd=None, shell=False, output=False):
+def FDroidPopen(commands, cwd=None, shell=False, output=True):
     """
     Run a command and capture the possibly huge output.