From d984c67c3bb6e9072f40ad99765741a52b5239f6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 25 Apr 2023 12:05:09 +0300 Subject: Fix worker broken with the previous commit --- bbot/worker/worker.cxx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'bbot') diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 9d3962c..f9550f8 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -2238,6 +2238,11 @@ build (size_t argc, const char* argv[]) // bool create_install (!target_pkg && (install_root || bindist)); + // Configuration where the package will be installed from. + // + dir_path effective_install_conf ( + rwd / (create_install ? install_conf : main_pkg_conf)); + // Root configuration through which we will be configuring the cluster // (note: does not necessarily match the main package type). // @@ -3731,13 +3736,9 @@ build (size_t argc, const char* argv[]) // if (install_root) { - // Make install_conf refer to the actual configuration directory. - // - install_conf = rwd / (create_install ? install_conf : main_pkg_conf); - operation_result& r (add_result ("install")); - change_wd (trace, &r.log, install_conf); + change_wd (trace, &r.log, effective_install_conf); // Note that for a host or module package we don't need the target // configuration anymore, if present. So let's free up the space a @@ -4378,19 +4379,13 @@ build (size_t argc, const char* argv[]) // if (!module_pkg) { - // Make install_conf refer to the actual configuration directory, if - // not yet. - // - if (sys_install) - install_conf = rwd / (create_install ? install_conf : main_pkg_conf); - assert (!rm.results.empty ()); // Result of the install or sys-install operation. // operation_result& r (rm.results.back ()); - change_wd (trace, &r.log, install_conf); + change_wd (trace, &r.log, effective_install_conf); for (const b_project_info::subproject& sp: prj.subprojects) { @@ -5317,7 +5312,7 @@ build (size_t argc, const char* argv[]) { operation_result& r (add_result ("uninstall")); - change_wd (trace, &r.log, install_conf); + change_wd (trace, &r.log, effective_install_conf); // bpkg uninstall // @@ -5373,6 +5368,8 @@ build (size_t argc, const char* argv[]) { operation_result& r (add_result ("upload")); + change_wd (trace, &r.log, rwd); + dir_path d (upload_dir / dir_path ("bindist") / dir_path (bindist_result.distribution)); @@ -5393,12 +5390,15 @@ build (size_t argc, const char* argv[]) #else bool mv (false); #endif - // Use relative paths to keep the operation log tidy. + // Use relative path, if possible, to keep the operation log tidy + // (won't be the case on Fedora). // + const path& rp (p.sub (rwd) ? p.leaf (rwd) : p); + if (mv) - mv_into (trace, &r.log, p.leaf (rwd), d); + mv_into (trace, &r.log, rp, d); else - cp_into (trace, &r.log, p.leaf (rwd), d); + cp_into (trace, &r.log, rp, d); }; auto move_files = [&mv] (const vector& bfs) -- cgit v1.1