From db05f8ead4c2b5ef8a27c3ffc6b20c291b0e7c8c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 19 May 2020 14:50:16 +0300 Subject: Set proper build script command default redirects Also add printing of set and exit pseudo-builtin command arguments for verb >= 2 as we do for normal builtins. --- libbuild2/build/script/script.cxx | 5 ++++- libbuild2/build/script/script.hxx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'libbuild2/build') diff --git a/libbuild2/build/script/script.cxx b/libbuild2/build/script/script.cxx index 5dbd24c..2a796ab 100644 --- a/libbuild2/build/script/script.cxx +++ b/libbuild2/build/script/script.cxx @@ -25,7 +25,10 @@ namespace build2 pt.ctx, cast (pt.ctx.global_scope["build.host"]), work, - wd_name), + wd_name, + redirect (redirect_type::none), + redirect (redirect_type::merge, 2), + redirect (redirect_type::pass)), script (s), primary_target (pt), vars (context, false /* global */) diff --git a/libbuild2/build/script/script.hxx b/libbuild2/build/script/script.hxx index dfd725b..8569a1f 100644 --- a/libbuild2/build/script/script.hxx +++ b/libbuild2/build/script/script.hxx @@ -20,10 +20,18 @@ namespace build2 { using build2::script::line; using build2::script::line_type; + using build2::script::redirect; + using build2::script::redirect_type; using build2::script::command_expr; - // Once parsed, the script can be executed in multiple threads with the - // state (variable values, etc) maintained in the environment object. + // Notes: + // + // - Once parsed, the script can be executed in multiple threads with + // the state (variable values, etc) maintained in the environment + // object. + // + // - The default script command redirects semantics is none for stdin, + // merge into stderr for stdout, and pass for stderr. // class script { -- cgit v1.1