chiark / gitweb /
Don't do everything unless --all is given
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 22 Dec 2013 20:31:35 +0000 (21:31 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 22 Dec 2013 20:31:35 +0000 (21:31 +0100)
fdroidserver/build.py
fdroidserver/install.py

index d2239043fd7d7300bd82d4d1b1b6e1cb0d492d5f..184584e7f62c6d77276f20cd63a6899c7192beaf 100644 (file)
@@ -833,6 +833,10 @@ def main():
     global options, config
 
     options, args = parse_commandline()
+    if not args and not options.all:
+        print "If you really want to build all the apps, use --all"
+        sys.exit(1)
+
     config = common.read_config(options)
 
     if config['build_server_always']:
index 3f23a16bf09c5e54818451e8ce9f7f14a4caf1d3..a133ede59576c96c2ec446096c9b9313c22aac8b 100644 (file)
@@ -48,6 +48,10 @@ def main():
                       help="Install all signed applications available")
     (options, args) = parser.parse_args()
 
+    if not args and not options.all:
+        print "If you really want to install all the signed apps, use --all"
+        sys.exit(1)
+
     config = common.read_config(options)
 
     output_dir = 'repo'
@@ -74,16 +78,10 @@ def main():
             if not apk:
                 raise Exception("No signed apk available for %s" % appid)
 
-    elif options.all:
-
-        for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
-
-            appid, vercode = common.apknameinfo(apkfile)
-            apks[appid] = apkfile
-
     else:
-        print "If you really want to install all the signed apps, use --all"
-        sys.exit(0)
+
+        apks = { common.apknameinfo(apkfile)[0] : apkfile for apkfile in
+                sorted(glob.glob(os.path.join(output_dir, '*.apk'))) }
     
     for appid, apk in apks.iteritems():
         # Get device list each time to avoid device not found errors