From 49c6210a1ae21b6722d513bd35ba90ee1fec3170 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 May 2020 15:44:32 +0200 Subject: Integrate buildscript running into recipe default_action() --- libbuild2/script/run.cxx | 50 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'libbuild2/script/run.cxx') diff --git a/libbuild2/script/run.cxx b/libbuild2/script/run.cxx index 00330a5..a1cd733 100644 --- a/libbuild2/script/run.cxx +++ b/libbuild2/script/run.cxx @@ -439,34 +439,34 @@ namespace build2 // the program output doesn't match. // auto save_regex = [&op, &rl, &rd, &ll, &line] () -> path - { - path rp (op + ".regex"); + { + path rp (op + ".regex"); - // Encode here-document regex global flags if present as a file - // name suffix. For example if icase and idot flags are specified - // the name will look like: - // - // stdout.regex-di - // - if (rd.type == redirect_type::here_doc_regex && !rl.flags.empty ()) - rp += '-' + rl.flags; + // Encode here-document regex global flags if present as a file + // name suffix. For example if icase and idot flags are specified + // the name will look like: + // + // stdout.regex-di + // + if (rd.type == redirect_type::here_doc_regex && !rl.flags.empty ()) + rp += '-' + rl.flags; - // Note that if would be more efficient to directly write chunks - // to file rather than to compose a string first. Hower we don't - // bother (about performance) for the sake of the code as we - // already failed. - // - string s; - for (auto b (rl.lines.cbegin ()), i (b), e (rl.lines.cend ()); - i != e; ++i) - { - if (i != b) s += '\n'; - s += line (*i); - } + // Note that if would be more efficient to directly write chunks + // to file rather than to compose a string first. Hower we don't + // bother (about performance) for the sake of the code as we + // already failed. + // + string s; + for (auto b (rl.lines.cbegin ()), i (b), e (rl.lines.cend ()); + i != e; ++i) + { + if (i != b) s += '\n'; + s += line (*i); + } - save (rp, s, ll); - return rp; - }; + save (rp, s, ll); + return rp; + }; // Finally create regex line string. // -- cgit v1.1