chiark / gitweb /
common: allow starting without a config file
[fdroidserver.git] / fdroid
diff --git a/fdroid b/fdroid
index 045f2aacf8e5f133c61fff43c126d7bcb1add75b..0b483e0150e98f795e39f84d7096e83c4e9e5159 100755 (executable)
--- a/fdroid
+++ b/fdroid
@@ -23,25 +23,29 @@ import logging
 import fdroidserver.common
 import fdroidserver.metadata
 from argparse import ArgumentError
-
-commands = {
-    "build": "Build a package from source",
-    "init": "Quickly start a new repository",
-    "publish": "Sign and place packages in the repo",
-    "gpgsign": "Add gpg signatures for packages in repo",
-    "update": "Update repo information for new packages",
-    "verify": "Verify the integrity of downloaded packages",
-    "checkupdates": "Check for updates to applications",
-    "import": "Add a new application from its source code",
-    "install": "Install built packages on devices",
-    "readmeta": "Read all the metadata files and exit",
-    "rewritemeta": "Rewrite all the metadata files",
-    "lint": "Warn about possible metadata errors",
-    "scanner": "Scan the source code of a package",
-    "stats": "Update the stats of the repo",
-    "server": "Interact with the repo HTTP server",
-    "signindex": "Sign indexes created using update --nosign",
-}
+from collections import OrderedDict
+
+commands = OrderedDict([
+    ("build", "Build a package from source"),
+    ("init", "Quickly start a new repository"),
+    ("publish", "Sign and place packages in the repo"),
+    ("gpgsign", "Add gpg signatures for packages in repo"),
+    ("update", "Update repo information for new packages"),
+    ("verify", "Verify the integrity of downloaded packages"),
+    ("checkupdates", "Check for updates to applications"),
+    ("import", "Add a new application from its source code"),
+    ("install", "Install built packages on devices"),
+    ("readmeta", "Read all the metadata files and exit"),
+    ("rewritemeta", "Rewrite all the metadata files"),
+    ("lint", "Warn about possible metadata errors"),
+    ("scanner", "Scan the source code of a package"),
+    ("dscanner", "Dynamically scan APKs post build"),
+    ("stats", "Update the stats of the repo"),
+    ("server", "Interact with the repo HTTP server"),
+    ("signindex", "Sign indexes created using update --nosign"),
+    ("btlog", "Update the binary transparency log for a URL"),
+    ("signatures", "Extract signatures from APKs"),
+])
 
 
 def print_help():
@@ -76,9 +80,11 @@ def main():
                     import subprocess
                     try:
                         output = subprocess.check_output(['git', 'describe'],
-                                                         stderr=subprocess.STDOUT)
+                                                         stderr=subprocess.STDOUT,
+                                                         universal_newlines=True)
                     except subprocess.CalledProcessError:
-                        output = 'git commit ' + subprocess.check_output(['git', 'rev-parse', 'HEAD'])
+                        output = 'git commit ' + subprocess.check_output(['git', 'rev-parse', 'HEAD'],
+                                                                         universal_newlines=True)
                 elif os.path.exists('setup.py'):
                     import re
                     m = re.search(r'''.*[\s,\(]+version\s*=\s*["']([0-9a-z.]+)["'].*''',
@@ -141,5 +147,6 @@ def main():
         raise
     sys.exit(0)
 
+
 if __name__ == "__main__":
     main()