chiark / gitweb /
Validate publish-related file existence before proceeding
authorCiaran Gultnieks <ciaran@ciarang.com>
Fri, 4 Apr 2014 14:37:18 +0000 (15:37 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Fri, 4 Apr 2014 14:37:18 +0000 (15:37 +0100)
fdroidserver/publish.py

index 101da26c9109739f4e7efd5511be51942221ccc9..8a9c8aeb83fda559d61b1bfa6fc75e01568ad693 100644 (file)
@@ -63,8 +63,13 @@ def main():
 
     unsigned_dir = 'unsigned'
     if not os.path.isdir(unsigned_dir):
-        logging.info("No unsigned directory - nothing to do")
-        sys.exit(0)
+        logging.warning("No unsigned directory - nothing to do")
+        sys.exit(1)
+
+    for f in [config['keystorepassfile'], config['keystore'], config['keypassfile']]:
+        if not os.path.exists(f):
+            logging.error("Config error - missing '{0}'".format(f))
+            sys.exit(1)
 
     # It was suggested at https://dev.guardianproject.info/projects/bazaar/wiki/FDroid_Audit
     # that a package could be crafted, such that it would use the same signing
@@ -82,7 +87,7 @@ def main():
         m.update(app['id'])
         keyalias = m.hexdigest()[:8]
         if keyalias in allaliases:
-            logging.info("There is a keyalias collision - publishing halted")
+            logging.error("There is a keyalias collision - publishing halted")
             sys.exit(1)
         allaliases.append(keyalias)
     logging.info("{0} apps, {0} key aliases".format(len(allapps), len(allaliases)))