From 7b5a0b55569331560f9cb6439ee818c3ce5d8428 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 22 Aug 2019 22:04:34 +0300 Subject: Quote directory paths in buildspecs Also fix some tests to properly work if the project path contain spaces. --- bpkg/pkg-checkout.cxx | 8 ++++---- tests/cfg-create.testscript | 2 +- tests/pkg-build.testscript | 2 ++ tests/remote-git.testscript | 2 ++ tests/rep-fetch.testscript | 2 ++ 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% -- cgit v1.1