Pick up dev/run defaults from install.mk
To avoid having to specify --enable-nouveau and --with-nouveau twice.
Once it's configured, dev/run should keep starting it. Until we run configure again to disable.
diff --git a/dev/run b/dev/run
index 79dc29a..27fcb15 100755
--- a/dev/run
+++ b/dev/run
@@ -117,6 +117,7 @@
def get_args_parser():
+ install_mk = get_install_mk()
parser = optparse.OptionParser(description="Runs CouchDB dev cluster")
parser.add_option(
"-a",
@@ -230,7 +231,7 @@
parser.add_option(
"--with-nouveau",
dest="with_nouveau",
- default=False,
+ default=install_mk.get("with_nouveau") == "true",
action="store_true",
help="Start Nouveau server",
)
@@ -538,6 +539,7 @@
return boot_nouveau(ctx)
+@log("Booting nouveau")
def boot_nouveau(ctx):
config = os.path.join(ctx["devdir"], "lib", "nouveau.yaml")
cmd = [
@@ -1204,6 +1206,30 @@
ensure_all_nodes_alive(ctx)
+def get_install_mk():
+ fpath = os.path.abspath(__file__)
+ rootdir = os.path.dirname(os.path.dirname(fpath))
+ install_mk_path = os.path.join(rootdir, "install.mk")
+ install_mk = {}
+ with open(install_mk_path) as fh:
+ for line in fh.readlines():
+ line = line.strip()
+ if not line:
+ continue
+ if line.startswith("#"):
+ continue
+ split = line.split("=", 1)
+ if len(split) != 2:
+ continue
+ [key, val] = split
+ key = key.strip()
+ val = val.strip()
+ if not key or not val:
+ continue
+ install_mk[key] = val
+ return install_mk
+
+
if __name__ == "__main__":
try:
main()