chiark / gitweb /
Switch all headers to python3
[fdroidserver.git] / fdroidserver / signindex.py
index 9b571a20a4e61de0ec4fca4011b818464dc0b5ec..7ae9fb7b126da80ba00053edb9a3628e04a3418b 100644 (file)
@@ -1,5 +1,4 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
 #
 # gpgsign.py - part of the FDroid server tools
 # Copyright (C) 2015, Ciaran Gultnieks, ciaran@ciarang.com
@@ -40,6 +39,10 @@ def main():
 
     config = common.read_config(options)
 
+    if 'jarsigner' not in config:
+        logging.critical('Java jarsigner not found! Install in standard location or set java_paths!')
+        sys.exit(1)
+
     repodirs = ['repo']
     if config['archive_older'] != 0:
         repodirs.append('archive')
@@ -53,9 +56,9 @@ def main():
         unsigned = os.path.join(output_dir, 'index_unsigned.jar')
         if os.path.exists(unsigned):
 
-            args = ['jarsigner', '-keystore', config['keystore'],
+            args = [config['jarsigner'], '-keystore', config['keystore'],
                     '-storepass:file', config['keystorepassfile'],
-                    '-digestalg', 'SHA1', '-sigalg', 'MD5withRSA',
+                    '-digestalg', 'SHA1', '-sigalg', 'SHA1withRSA',
                     unsigned, config['repo_keyalias']]
             if config['keystore'] == 'NONE':
                 args += config['smartcardoptions']