aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-09-05 19:03:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-09-05 19:03:41 +0200
commit583079bea545963cbc964a53dbacb2174be97799 (patch)
treeae52f0ed6ffbaaf9a6a83a50e55fb53036e8ed47
parent642adde3f1df3db2d1d2b0ef9321c5b0954d4368 (diff)
Add major.minor version to created bpkg configuration directory
-rw-r--r--build-mingw.bat14
-rw-r--r--build-msvc.bat14
-rwxr-xr-xbuild.sh14
3 files changed, 27 insertions, 15 deletions
diff --git a/build-mingw.bat b/build-mingw.bat
index 0c74cd7..ed4fc31 100644
--- a/build-mingw.bat
+++ b/build-mingw.bat
@@ -36,6 +36,11 @@ set "BUILD2_REPO=https://stage.build2.org/1"
rem set "BUILD2_REPO=https://pkg.cppget.org/1/alpha"
)
+rem Bpkg configuration directory.
+rem
+set "cver=0.4"
+set "cdir=build2-toolchain-%cver%"
+
rem Compiler.
rem
if "_%1_" == "__" (
@@ -63,8 +68,8 @@ if exist build\config.build (
goto error
)
-if exist ..\build2-toolchain\ (
- echo ..\build2-toolchain\ bpkg configuration directory already exists
+if exist ..\%cdir%\ (
+ echo ..\%cdir%\ bpkg configuration directory already exists
goto error
)
@@ -125,11 +130,10 @@ bpkg-stage --version
@rem
cd ..
-md build2-toolchain
+md %cdir%
@if errorlevel 1 goto error
-cd build2-toolchain
-@set "cdir=%CD%"
+cd %cdir%
bpkg-stage create^
cc^
diff --git a/build-msvc.bat b/build-msvc.bat
index 3f8758d..95e194f 100644
--- a/build-msvc.bat
+++ b/build-msvc.bat
@@ -36,6 +36,11 @@ set "BUILD2_REPO=https://stage.build2.org/1"
rem set "BUILD2_REPO=https://pkg.cppget.org/1/alpha"
)
+rem Bpkg configuration directory.
+rem
+set "cver=0.4"
+set "cdir=build2-toolchain-%cver%"
+
rem Installation directory.
rem
if "_%1_" == "__" (
@@ -54,8 +59,8 @@ if exist build\config.build (
goto error
)
-if exist ..\build2-toolchain\ (
- echo ..\build2-toolchain\ bpkg configuration directory already exists
+if exist ..\%cdir%\ (
+ echo ..\%cdir%\ bpkg configuration directory already exists
goto error
)
@@ -117,11 +122,10 @@ bpkg-stage --version
@rem
cd ..
-md build2-toolchain
+md %cdir%
@if errorlevel 1 goto error
-cd build2-toolchain
-@set "cdir=%CD%"
+cd %cdir%
bpkg-stage create^
cc^
diff --git a/build.sh b/build.sh
index 820d89f..5c2f886 100755
--- a/build.sh
+++ b/build.sh
@@ -18,6 +18,11 @@ if test -z "$BUILD2_REPO"; then
# BUILD2_REPO="https://pkg.cppget.org/1/alpha"
fi
+# Bpkg configuration directory.
+#
+cver="0.4"
+cdir="build2-toolchain-$cver"
+
diag ()
{
echo "$*" 1>&2
@@ -134,8 +139,8 @@ if test -f build/config.build; then
exit 1
fi
-if test -d ../build2-toolchain; then
- diag "../build2-toolchain/ bpkg configuration directory already exists"
+if test -d "../$cdir"; then
+ diag "../$cdir/ bpkg configuration directory already exists"
exit 1
fi
@@ -195,9 +200,8 @@ run bpkg-stage --version
# Install.
#
run cd ..
-run mkdir build2-toolchain
-run cd build2-toolchain
-cdir="$(pwd)"
+run mkdir "$cdir"
+run cd "$cdir"
run bpkg-stage create \
cc \