chiark / gitweb /
use jarsigner and keytool from same JDK as is being set in JAVA7_HOME
[fdroidserver.git] / fdroidserver / update.py
index 3a01a7c21cb2db097621d45eca9fd828053c4fbf..6bbf0fae9686d2f3fd30b719b59e3400a3faaaea 100644 (file)
@@ -103,7 +103,7 @@ def update_wiki(apps, sortedids, apks):
             requiresroot = 'Yes'
         else:
             requiresroot = 'No'
-        wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|changelog=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|license=%s|root=%s}}\n' % (
+        wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|changelog=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|license=%s|root=%s|author=%s|email=%s}}\n' % (
             appid,
             app.Name,
             time.strftime('%Y-%m-%d', app.added) if app.added else '',
@@ -117,7 +117,9 @@ def update_wiki(apps, sortedids, apks):
             app.Bitcoin,
             app.Litecoin,
             app.License,
-            requiresroot)
+            requiresroot,
+            app.AuthorName,
+            app.AuthorEmail)
 
         if app.Provides:
             wikidata += "This app provides: %s" % ', '.join(app.Summary.split(','))
@@ -331,7 +333,7 @@ def resize_icon(iconpath, density):
                 iconpath, oldsize, im.size))
             im.save(iconpath, "PNG")
 
-    except Exception, e:
+    except Exception as e:
         logging.error("Failed resizing {0} - {1}".format(iconpath, e))
 
 
@@ -365,7 +367,7 @@ def getsig(apkpath):
     cert = None
 
     # verify the jar signature is correct
-    args = ['jarsigner', '-verify', apkpath]
+    args = [config['jarsigner'], '-verify', apkpath]
     p = FDroidPopen(args)
     if p.returncode != 0:
         logging.critical(apkpath + " has a bad signature!")
@@ -490,7 +492,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
                         apk['id'] = re.match(name_pat, line).group(1)
                         apk['versioncode'] = int(re.match(vercode_pat, line).group(1))
                         apk['version'] = re.match(vername_pat, line).group(1)
-                    except Exception, e:
+                    except Exception as e:
                         logging.error("Package matching failed: " + str(e))
                         logging.info("Line was: " + line)
                         sys.exit(1)
@@ -615,7 +617,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
                                         os.path.join(get_icon_dir(repodir, density), iconfilename))
                             empty_densities.remove(density)
                             break
-                except Exception, e:
+                except Exception as e:
                     logging.warn("Failed reading {0} - {1}".format(iconpath, e))
 
             if apk['icons']:
@@ -709,7 +711,7 @@ def extract_pubkey():
     if 'repo_pubkey' in config:
         pubkey = unhexlify(config['repo_pubkey'])
     else:
-        p = FDroidPopen(['keytool', '-exportcert',
+        p = FDroidPopen([config['keytool'], '-exportcert',
                          '-alias', config['repo_keyalias'],
                          '-keystore', config['keystore'],
                          '-storepass:file', config['keystorepassfile']]
@@ -850,6 +852,8 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
         addElement('source', app.SourceCode, doc, apel)
         addElement('tracker', app.IssueTracker, doc, apel)
         addElementNonEmpty('changelog', app.Changelog, doc, apel)
+        addElementNonEmpty('author', app.AuthorName, doc, apel)
+        addElementNonEmpty('email', app.AuthorEmail, doc, apel)
         addElementNonEmpty('donate', app.Donate, doc, apel)
         addElementNonEmpty('bitcoin', app.Bitcoin, doc, apel)
         addElementNonEmpty('litecoin', app.Litecoin, doc, apel)
@@ -966,7 +970,7 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
             if os.path.exists(signed):
                 os.remove(signed)
         else:
-            args = ['jarsigner', '-keystore', config['keystore'],
+            args = [config['jarsigner'], '-keystore', config['keystore'],
                     '-storepass:file', config['keystorepassfile'],
                     '-digestalg', 'SHA1', '-sigalg', 'SHA1withRSA',
                     signed, config['repo_keyalias']]
@@ -1114,6 +1118,10 @@ def main():
 
     config = common.read_config(options)
 
+    if not ('jarsigner' in config and 'keytool' in config):
+        logging.critical('Java JDK not found! Install in standard location or set java_paths!')
+        sys.exit(1)
+
     repodirs = ['repo']
     if config['archive_older'] != 0:
         repodirs.append('archive')