aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/build-config.cxx20
-rw-r--r--mod/build-config.hxx16
-rw-r--r--mod/mod-build-task.cxx4
3 files changed, 21 insertions, 19 deletions
diff --git a/mod/build-config.cxx b/mod/build-config.cxx
index 9368d33..1c9d578 100644
--- a/mod/build-config.cxx
+++ b/mod/build-config.cxx
@@ -245,27 +245,27 @@ namespace brep
// Now check if the configuration is excluded/included via the patterns.
//
- // To implement matching of absent name components with wildcard-only name
- // components we are going to convert names into paths (see
- // from_build_config_name() for details).
+ // To implement matching of absent name components with wildcard-only
+ // pattern components we are going to convert names to paths (see
+ // dash_components_to_path() for details).
//
// And if any of the build-{include,exclude} values (which is legal) or
- // the build configuration name/target (illegal) are invalid paths,
- // then we assume no match.
+ // the build configuration name/target (illegal) are invalid paths, then
+ // we assume no match.
//
try
{
- path cn (from_build_config_name (cfg.name));
- path tg (from_build_config_name (cfg.target.string ()));
+ path cn (dash_components_to_path (cfg.name));
+ path tg (dash_components_to_path (cfg.target.string ()));
for (const build_constraint& c: constrs)
{
- if (path_match (from_build_config_name (c.config),
+ if (path_match (dash_components_to_path (c.config),
cn,
dir_path () /* start */,
path_match_flags::match_absent) &&
(!c.target ||
- path_match (from_build_config_name (*c.target),
+ path_match (dash_components_to_path (*c.target),
tg,
dir_path () /* start */,
path_match_flags::match_absent)))
@@ -286,7 +286,7 @@ namespace brep
}
path
- from_build_config_name (const string& s)
+ dash_components_to_path (const string& s)
{
string r;
for (size_t i (0); i != s.size (); ++i)
diff --git a/mod/build-config.hxx b/mod/build-config.hxx
index a6f9902..17fd6af 100644
--- a/mod/build-config.hxx
+++ b/mod/build-config.hxx
@@ -81,16 +81,18 @@ namespace brep
return exclude (p.builds, p.constraints, c, r);
}
- // Convert the build configuration name, target, machine name or their
- // pattern into path, replacing dashes with slashes and double stars with
- // the `*/**/*` substring for a subsequent match using our path_match()
- // functionality. Throw invalid_path if the resulting path is invalid.
+ // 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.
//
- // Note that it is assumed that the match_absent path match flag will be
- // used for matching for the double star replacement to make sense.
+ // Note that the match_absent path match flag must be used for the above
+ // `**` transformation to work.
//
path
- from_build_config_name (const string&);
+ dash_components_to_path (const string&);
}
#endif // MOD_BUILD_CONFIG_HXX
diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx
index d66e90c..14c72ac 100644
--- a/mod/mod-build-task.cxx
+++ b/mod/mod-build-task.cxx
@@ -158,8 +158,8 @@ handle (request& rq, response& rs)
//
try
{
- if (path_match (from_build_config_name (c.machine_pattern),
- from_build_config_name (m.name),
+ if (path_match (dash_components_to_path (c.machine_pattern),
+ dash_components_to_path (m.name),
dir_path () /* start */,
path_match_flags::match_absent) &&
cfg_machines.insert (