Skip to contentSkip to conversation

build: msvc: chdir with change drive to script location

PATCH Applied Alon Bar-Lev 3 participants 4 messages Apr 28, 2012 – Jun 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: msvc: chdir with change drive to script location

---
 msvc-build.bat |    1 +
 msvc-dev.bat   |    2 +-
 msvc-env.bat   |    2 --
 3 files changed, 2 insertions(+), 3 deletions(-)
msvc-build.bat +1 -0
index 01417d1..fd6d558 100644
@@ -4,6 +4,7 @@ rem Copyright (C) 2008-2012 Alon Bar-Lev <[email protected]...>
 @rem this stupid command needed for SetEnv.cmd to operate
 setlocal ENABLEDELAYEDEXPANSION
 
+cd /d %0\..
 call msvc-env.bat
 
 set PLATFORMS=Win32
msvc-dev.bat +1 -1
index 4dac172..dbd7be0 100644
@@ -1,7 +1,7 @@
 @echo off
 
 setlocal
-cd %0\..
+cd /d %0\..
 call msvc-env.bat
 
 if exist "%VSHOME%\Common7\IDE\VCExpress.exe" (
msvc-env.bat +0 -2
index 3c9eb5b..2dd0f00 100644
@@ -1,7 +1,5 @@
 @echo off
 
-cd %0\..
-
 rem Put your own settings at msvc-env-local.bat
 if exist msvc-env-local.bat call msvc-env-local.bat
 
Signature · 1 line
1.7.3.4
#1 lore raw

Please apply.
https://github.com/alonbl/openvpn/commit/692c35a3cce6226dd36bbc6b9138a353d1d14634

Quoted 47 lines · Alon Bar-Lev

---
 msvc-build.bat |    1 +
 msvc-dev.bat   |    2 +-
 msvc-env.bat   |    2 --

 3 files changed, 2 insertions(+), 3 deletions(-)
msvc-build.bat +0 -0
index 01417d1..fd6d558 100644
@@ -4,6 +4,7 @@ rem Copyright (C) 2008-2012 Alon Bar-Lev <[email protected]...>

 @...1738... this stupid command needed for SetEnv.cmd to operate setlocal ENABLEDELAYEDEXPANSION

+cd /d %0\..
 call msvc-env.bat

 set PLATFORMS=Win32

msvc-dev.bat +0 -0
index 4dac172..dbd7be0 100644
@@ -1,7 +1,7 @@

 @...1657... off

 setlocal

msvc-dev.bat +1 -1
-cd %0\..
+cd /d %0\..

 call msvc-env.bat

 if exist "%VSHOME%\Common7\IDE\VCExpress.exe" (

msvc-env.bat +0 -0
index 3c9eb5b..2dd0f00 100644
@@ -1,7 +1,5 @@

 @...1657... off

msvc-env.bat +0 -2
-cd %0\..
-

 rem Put your own settings at msvc-env-local.bat if exist msvc-env-local.bat call msvc-env-local.bat

--
1.7.3.4

#2 lore raw
In reply to Alon Bar-Lev

I tested building with "openvpn-build\msvc" with this patch applied, and it still worked. I don't see any reason not to apply this, so it's an ACK.

The "cd /d %0\.." magic is very interesting... "cd %0\.." seems to work exactly the same: both switch to the directory where msvc-build.bat is located (i.e. openvpn build root).
If I understood correctly, the /d switch allows changing to a directory on an another drive, right?

Samuli

Quoted 44 lines
---
 msvc-build.bat |    1 +
 msvc-dev.bat   |    2 +-
 msvc-env.bat   |    2 --
 3 files changed, 2 insertions(+), 3 deletions(-)
msvc-build.bat +1 -0
index 01417d1..fd6d558 100644
@@ -4,6 +4,7 @@ rem Copyright (C) 2008-2012 Alon Bar-Lev <[email protected]...>
 @rem this stupid command needed for SetEnv.cmd to operate
 setlocal ENABLEDELAYEDEXPANSION
 
+cd /d %0\..
 call msvc-env.bat
 
 set PLATFORMS=Win32
msvc-dev.bat +1 -1
index 4dac172..dbd7be0 100644
@@ -1,7 +1,7 @@
 @echo off
 
 setlocal
-cd %0\..
+cd /d %0\..
 call msvc-env.bat
 
 if exist "%VSHOME%\Common7\IDE\VCExpress.exe" (
msvc-env.bat +0 -2
index 3c9eb5b..2dd0f00 100644
@@ -1,7 +1,5 @@
 @echo off
 
-cd %0\..
-
 rem Put your own settings at msvc-env-local.bat
 if exist msvc-env-local.bat call msvc-env-local.bat
 
#3 lore raw
In reply to Alon Bar-Lev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Alon Bar-Lev

msvc-build.bat | 1 + msvc-dev.bat | 2 +- msvc-env.bat |
2 -- 3 files changed, 2 insertions(+), 3 deletions(-)

Applied to master.

commit 6d2b65ad322e587efaf43c1b8cf6da8c36cf1ae1

Author: Alon Bar-Lev <[email protected]...>
Date:   Sat Apr 28 21:51:58 2012 +0300
    build: msvc: chdir with change drive to script location

    Signed-off-by: Alon Bar-Lev <[email protected]...>
    Acked-by: Samuli Seppänen <[email protected]...>
    Message-Id: [email protected]...
    URL: http://article.gmane.org/gmane.network.openvpn.devel/6383
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/tZvIACgkQDC186MBRfrppvACfSGt/dhmxvIJdMD0+1WacGJKy 2PsAn1kWrwj8SKiXF6sXJyYTc8rT06uG
=3iVf
-----END PGP SIGNATURE-----