[ovs-dev,4/8] ovs-dev.py: allow current directory to be used as the working directory
diff mbox

Message ID 1442969477-11026-4-git-send-email-azhou@nicira.com
State Accepted
Headers show

Commit Message

Andy Zhou Sept. 23, 2015, 12:51 a.m. UTC
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>
---
 utilities/ovs-dev.py | 3 +++
 1 file changed, 3 insertions(+)

Comments

Joe Stringer Sept. 30, 2015, 11:51 p.m. UTC | #1
On 22 September 2015 at 17:51, Andy Zhou <azhou@nicira.com> wrote:
> 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>

Patch
diff mbox

diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 8128b08..54989e6 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -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"