aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-22 22:04:34 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-22 22:04:51 +0300
commit7b5a0b55569331560f9cb6439ee818c3ce5d8428 (patch)
tree716701cfb044388fe6c33d1746a0292189c56147
parent5384724d937196e1e3f5c15fe443c0bff07896e6 (diff)
Quote directory paths in buildspecs
Also fix some tests to properly work if the project path contain spaces.
-rw-r--r--bpkg/pkg-checkout.cxx8
-rw-r--r--tests/cfg-create.testscript2
-rw-r--r--tests/pkg-build.testscript2
-rw-r--r--tests/remote-git.testscript2
-rw-r--r--tests/rep-fetch.testscript2
5 files changed, 11 insertions, 5 deletions
diff --git a/bpkg/pkg-checkout.cxx b/bpkg/pkg-checkout.cxx
index 764373e..f46da60 100644
--- a/bpkg/pkg-checkout.cxx
+++ b/bpkg/pkg-checkout.cxx
@@ -231,11 +231,11 @@ namespace bpkg
// Form the buildspec.
//
- string bspec ("dist(");
+ string bspec ("dist('");
bspec += pd.representation ();
- bspec += '@';
+ bspec += "'@'";
bspec += od.representation ();
- bspec += ')';
+ bspec += "')";
// Remove the resulting package distribution directory on failure.
//
@@ -262,7 +262,7 @@ namespace bpkg
run_b (o,
verb_b::progress,
- strings ({"config.dist.root=" + c.representation ()}),
+ strings ({"config.dist.root='" + c.representation () + "'"}),
bspec);
// Revert the fix-ups.
diff --git a/tests/cfg-create.testscript b/tests/cfg-create.testscript
index 2403085..68aea13 100644
--- a/tests/cfg-create.testscript
+++ b/tests/cfg-create.testscript
@@ -32,7 +32,7 @@ EOE
: conf-var
:
{
- $* "config.install.root=$~/opt" 2>>/~%EOE%;
+ $* "config.install.root='$~/opt'" 2>>/~%EOE%;
%created new configuration in .+/cfg/%
EOE
diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript
index 824a4bb..4465081 100644
--- a/tests/pkg-build.testscript
+++ b/tests/pkg-build.testscript
@@ -3117,6 +3117,8 @@ test.options += --no-progress
rep = ($cxx.target.class != 'windows' \
? "file:$rep" \
: "file:/$regex.replace($rep, '\\', '/')")
+
+ rep = "$regex.replace($rep, ' ', '%20')"
end;
$* "$rep/t4d" 2>>~%EOE%;
diff --git a/tests/remote-git.testscript b/tests/remote-git.testscript
index 81e7c54..6c539b6 100644
--- a/tests/remote-git.testscript
+++ b/tests/remote-git.testscript
@@ -46,6 +46,8 @@ remote = $config.bpkg.test.remote
? "file://$out_git" \
: "file:/$regex.replace($out_git, '\\', '/')")
+ rep_git_local = "$regex.replace($rep_git_local, ' ', '%20')"
+
rep_git = $rep_git_local # Default local repository URL.
mkdir -p $out_git
diff --git a/tests/rep-fetch.testscript b/tests/rep-fetch.testscript
index ba707c2..bc52f2e 100644
--- a/tests/rep-fetch.testscript
+++ b/tests/rep-fetch.testscript
@@ -769,6 +769,8 @@ else
? "file:$~" \
: "file:/$regex.replace($~, '\\', '/')");
+ rep = "$regex.replace($rep, ' ', '%20')";
+
$* "$rep/libbar.git#master" 2>>~%EOE% &cfg/.bpkg/repos/*/***;
%added git:.+libbar#master%
%querying .+libbar\.git%