ovs-dev.py: allow current directory to be used as the working directory
authorAndy Zhou <azhou@nicira.com>
Fri, 11 Sep 2015 20:34:24 +0000 (13:34 -0700)
committerAndy Zhou <azhou@nicira.com>
Thu, 1 Oct 2015 03:43:53 +0000 (20:43 -0700)
Rather than forcing a single ovs source tree under ~/ovs, this
change supports invoking the script from the root of any
ovs source tree as the working source tree. If the script is invoked
from a directory not recognized as OVS source tree, ~/ovs will
then be used.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
utilities/ovs-dev.py

index 8128b08..54989e6 100755 (executable)
@@ -22,7 +22,10 @@ import tempfile
 
 ENV = os.environ
 HOME = ENV["HOME"]
+PWD = os.getcwd()
 OVS_SRC = HOME + "/ovs"
+if os.path.exists(PWD + "/WHY-OVS.md"):
+    OVS_SRC = PWD  # Use current directory as OVS source tree
 ROOT = HOME + "/root"
 BUILD_GCC = OVS_SRC + "/_build-gcc"
 BUILD_CLANG = OVS_SRC + "/_build-clang"