chiark / gitweb /
buildserver: run dir check as very first thing
authorHans-Christoph Steiner <hans@eds.org>
Mon, 26 Sep 2016 11:11:22 +0000 (07:11 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 28 Sep 2016 07:52:49 +0000 (09:52 +0200)
No point in running any other code if the script is just going to bail
out with an error.  This assumes that ./makebuildserver is only ever
run from a git clone of fdroidserver.git.

makebuildserver

index 69eea7b67fdd793349470fda784f3fa7ab7c8af3..eb41a21184b1c1f2dc8f6fdf345daf39cb7c747b 100755 (executable)
@@ -13,6 +13,11 @@ from clint.textui import progress
 from optparse import OptionParser
 
 
+if not os.path.exists('makebuildserver') and not os.path.exists('buildserver'):
+    print('This must be run as ./makebuildserver in fdroidserver.git!')
+    sys.exit(1)
+
+
 def vagrant(params, cwd=None, printout=False):
     """Run vagrant.
 
@@ -87,10 +92,6 @@ elif os.path.exists('makebs.config.py'):
 if '__builtins__' in config:
     del(config['__builtins__'])  # added by compile/exec
 
-if not os.path.exists('makebuildserver') or not os.path.exists(serverdir):
-    print('This must be run from the correct directory!')
-    sys.exit(1)
-
 if os.path.exists(boxfile):
     os.remove(boxfile)