aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-12-01 22:47:12 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-12-02 16:35:59 +0300
commit19bfa091d6132431713ab937332b153b31fd3759 (patch)
treef957871411d320148167309fdc38b883a57126a8
parent03afe0175b10526de1cec862191aca78dc75bc56 (diff)
Match dash-separated components (build configuration names, etc.) as directories
-rw-r--r--mod/build-config.cxx11
-rw-r--r--mod/build-config.hxx9
-rw-r--r--tests/load/1/math/libexp-+2-1.2+1.tar.gzbin388 -> 408 bytes
-rw-r--r--tests/load/1/math/packages.manifest4
-rw-r--r--tests/load/driver.cxx3
5 files changed, 21 insertions, 6 deletions
diff --git a/mod/build-config.cxx b/mod/build-config.cxx
index b11d7ea..6f2bc43 100644
--- a/mod/build-config.cxx
+++ b/mod/build-config.cxx
@@ -318,6 +318,17 @@ namespace brep
}
}
+ // Append the trailing slash to match the resulting paths as directories.
+ // This is required for the trailing /* we could append to match absent
+ // directory path components (see path_match_flags::match_absent for
+ // details).
+ //
+ // Note that valid dash components may not contain a trailing dash.
+ // Anyway, any extra trailing slashes will be ignored by the path
+ // constructor.
+ //
+ r += '/';
+
return path (move (r));
}
}
diff --git a/mod/build-config.hxx b/mod/build-config.hxx
index 17fd6af..6eece1d 100644
--- a/mod/build-config.hxx
+++ b/mod/build-config.hxx
@@ -83,10 +83,11 @@ namespace brep
// Convert dash-separated components (target, build configuration name,
// machine name) or a pattern thereof into a path, replacing dashes with
- // slashes (directory separators) and `**` with `*/**/*`, for a subsequent
- // match using the path_match() functionality (the idea here is for
- // `linux**` to match `linux-gcc` which is quite natural to expect). Throw
- // invalid_path if the resulting path is invalid.
+ // slashes (directory separators), `**` with `*/**/*`, and appending the
+ // trailing slash for a subsequent match using the path_match()
+ // functionality (the idea here is for `linux**` to match `linux-gcc` which
+ // is quite natural to expect). Throw invalid_path if the resulting path is
+ // invalid.
//
// Note that the match_absent path match flag must be used for the above
// `**` transformation to work.
diff --git a/tests/load/1/math/libexp-+2-1.2+1.tar.gz b/tests/load/1/math/libexp-+2-1.2+1.tar.gz
index c49541c..20c8434 100644
--- a/tests/load/1/math/libexp-+2-1.2+1.tar.gz
+++ b/tests/load/1/math/libexp-+2-1.2+1.tar.gz
Binary files differ
diff --git a/tests/load/1/math/packages.manifest b/tests/load/1/math/packages.manifest
index 31baa82..0bbf6d4 100644
--- a/tests/load/1/math/packages.manifest
+++ b/tests/load/1/math/packages.manifest
@@ -13,10 +13,12 @@ email: users@exp.example.com
build-email: builds@exp.example.com
depends: libmisc
depends: libpq >= 9.0.0
+builds: default legacy
build-include: windows**d/x86_64**
+build-include: windows-vc_13**
build-exclude: **; Only supported on Windows.
location: libexp-+2-1.2+1.tar.gz
-sha256sum: 6dc3ef269d7f50af2c234c51407eb5622e7395af8bf50a5f75880688c064b79b
+sha256sum: 4f476dab0cd13d4c7a4676b50180e66a9a10a65f92a3d335b8227a9a8ca58e21
:
name: libfoo
version: +0-X.Y
diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx
index 04e7368..e7a7eaa 100644
--- a/tests/load/driver.cxx
+++ b/tests/load/driver.cxx
@@ -830,11 +830,12 @@ test_pkg_repos (const cstrings& loader_args,
epv->build_constraints ==
build_constraints ({
build_constraint (false, "windows**d", "x86_64**", ""),
+ build_constraint (false, "windows-vc_13**", nullopt, ""),
build_constraint (true, "**", nullopt, "Only supported on Windows.")}));
assert (check_location (epv));
assert (epv->sha256sum && *epv->sha256sum ==
- "6dc3ef269d7f50af2c234c51407eb5622e7395af8bf50a5f75880688c064b79b");
+ "4f476dab0cd13d4c7a4676b50180e66a9a10a65f92a3d335b8227a9a8ca58e21");
// Verify libpq package version.
//