From 145adc9d4bc338657ce6f609dcac67682eb329e3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 17 Sep 2016 00:39:40 +0300 Subject: Audit all print_process()/process ctor for path_search() --- build2/dist/init.cxx | 6 +++--- build2/dist/operation.cxx | 32 +++++++++++++++++--------------- 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'build2/dist') diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx index 428ca5c..923c18f 100644 --- a/build2/dist/init.cxx +++ b/build2/dist/init.cxx @@ -51,7 +51,7 @@ namespace build2 v.insert ("config.dist.cmd", true); v.insert ("dist.root"); - v.insert ("dist.cmd"); + v.insert ("dist.cmd"); v.insert ("dist.archives"); v.insert ("dist", variable_visibility::target); // Flag. @@ -120,14 +120,14 @@ namespace build2 // dist.cmd // { - value& v (r.assign ("dist.cmd")); + value& v (r.assign ("dist.cmd")); if (s) { if (const value& cv = config::required (r, "config.dist.cmd", path ("install")).first) - v = cv; + v = run_search (cast (cv), true); } } diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx index b5ca906..e2d283c 100644 --- a/build2/dist/operation.cxx +++ b/build2/dist/operation.cxx @@ -38,12 +38,12 @@ namespace build2 // install -d // static void - install (const path& cmd, const dir_path&); + install (const process_path& cmd, const dir_path&); // install // static void - install (const path& cmd, file&, const dir_path&); + install (const process_path& cmd, file&, const dir_path&); // cd && tar|zip ... /. // @@ -95,7 +95,7 @@ namespace build2 info << "did you forget to set dist.package?"; const string& dist_package (cast (l)); - const path& dist_cmd (cast (rs->vars["dist.cmd"])); + const process_path& dist_cmd (cast (rs->vars["dist.cmd"])); // Get the list of operations supported by this project. Skip // default_id. @@ -314,11 +314,11 @@ namespace build2 // install -d // static void - install (const path& cmd, const dir_path& d) + install (const process_path& cmd, const dir_path& d) { path reld (relative (d)); - cstrings args {cmd.string ().c_str (), "-d"}; + cstrings args {cmd.recall_string (), "-d"}; args.push_back ("-m"); args.push_back ("755"); @@ -332,7 +332,7 @@ namespace build2 try { - process pr (args.data ()); + process pr (cmd, args.data ()); if (!pr.wait ()) throw failed (); @@ -351,12 +351,12 @@ namespace build2 // install // static void - install (const path& cmd, file& t, const dir_path& d) + install (const process_path& cmd, file& t, const dir_path& d) { dir_path reld (relative (d)); path relf (relative (t.path ())); - cstrings args {cmd.string ().c_str ()}; + cstrings args {cmd.recall_string ()}; // Preserve timestamps. This could becomes important if, for // example, we have pre-generated sources. Note that the @@ -386,7 +386,7 @@ namespace build2 try { - process pr (args.data ()); + process pr (cmd, args.data ()); if (!pr.wait ()) throw failed (); @@ -427,16 +427,18 @@ namespace build2 args = {"tar", "-a", "-cf", ap.string ().c_str (), pkg.c_str (), nullptr}; - if (verb >= 2) - print_process (args); - else if (verb) - text << args[0] << " " << ap; - try { + process_path pp (process::path_search (args[0])); + + if (verb >= 2) + print_process (args); + else if (verb) + text << args[0] << " " << ap; + // Change child's working directory to dist_root. // - process pr (root.string ().c_str (), args.data ()); + process pr (root.string ().c_str (), pp, args.data ()); if (!pr.wait ()) throw failed (); -- cgit v1.1