From patchwork Mon Sep 14 22:54:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 517611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3D492140D16 for ; Tue, 15 Sep 2015 08:55:08 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 56BCF1097C; Mon, 14 Sep 2015 15:54:36 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id D172B10921 for ; Mon, 14 Sep 2015 15:54:34 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id 4812C618E99 for ; Mon, 14 Sep 2015 16:54:34 -0600 (MDT) X-ASG-Debug-ID: 1442271273-03dc212ca705830001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar4.cudamail.com with ESMTP id xAtG9fcasD6gUxOb (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 14 Sep 2015 16:54:33 -0600 (MDT) X-Barracuda-Envelope-From: azhou@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-pa0-f43.google.com) (209.85.220.43) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 14 Sep 2015 22:54:32 -0000 Received-SPF: unknown (mx3-pf3.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.43 Received: by padhk3 with SMTP id hk3so155855075pad.3 for ; Mon, 14 Sep 2015 15:54:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LAX0bWW84s3oEpmACufrsDSeMF5OztDHflQiR533dFE=; b=ksuamPRqLv2pPyHhDXodCBWBo7Iv6viSEsTrw5r9bmmMvFQGL+qv17Y51Mvb2DFI75 ulszhb7mRk0RggCFA60vnBEtY3iJ1o9EA1/tcfT+SfHu/vGj6Mzug+WztVB0U5+zliiO 5BlLWYeCz97emsGCzZMdiseCafMA1+rhccvKf6W6HxgDT692/4oEXvamneKBFqJ7HOoO kv1qMw4HOJICUegkOaIYQl3WcNpo3gTdUacIjZYJbvJ5iT0BzgvUWFeB3yajjCWjHYwb BLppqM4Ji8mcUJYgS1gu0T321QazQHYWSJqmvKhBr40q5Uvwh6Wz7MlG9B+Pu7zNI7DD Cpkg== X-Gm-Message-State: ALoCoQmJSaYofAHST8aEcdr5OFSlrA/zuASvQ57afpADHm2mDH+zAawNs6fzrnE96JzBjcMYy7sL X-Received: by 10.68.65.43 with SMTP id u11mr40225272pbs.167.1442271272998; Mon, 14 Sep 2015 15:54:32 -0700 (PDT) Received: from ubuntu.localdomain ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id ox2sm18121426pbb.87.2015.09.14.15.54.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Sep 2015 15:54:32 -0700 (PDT) X-CudaMail-Envelope-Sender: azhou@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.1.34 From: Andy Zhou To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-913061780 X-CudaMail-DTE: 091415 X-CudaMail-Originating-IP: 209.85.220.43 Date: Mon, 14 Sep 2015 15:54:10 -0700 X-ASG-Orig-Subj: [##CM-V3-913061780##][v3 06/10] ovs-dev.py: allow current directory to be used as the working directory Message-Id: <1442271254-27897-7-git-send-email-azhou@nicira.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442271254-27897-1-git-send-email-azhou@nicira.com> References: <1442271254-27897-1-git-send-email-azhou@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1442271273 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [v3 06/10] ovs-dev.py: allow current directory to be used as the working directory X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 --- utilities/ovs-dev.py | 3 +++ 1 file changed, 3 insertions(+) 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"