From 92697b523aa53d233c7ddd43c88d38f558fcd3bd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 16 Jun 2022 15:43:45 +0300 Subject: Fix failing for outdated src-root.build --- bpkg/package-skeleton.cxx | 13 ++++++++----- bpkg/utility.cxx | 4 ++++ bpkg/utility.hxx | 4 ++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx index 96c93aa..2ca06cc 100644 --- a/bpkg/package-skeleton.cxx +++ b/bpkg/package-skeleton.cxx @@ -2688,14 +2688,17 @@ namespace bpkg // If the package directory was moved, then it's possible we will have // bootstrap.build with an old src_root value. Presumably this will // cause the package to be re-configured and so ignoring the old value - // here should be ok. + // here should be ok. Also let's remove the outdated bootstrap.build + // in this case, so it doesn't affect us down the road. // -#if 0 - assert (cast (v) == src_root); -#else if (cast (v) != src_root) + { v = src_root; -#endif + + assert (altn); // Since bootstrap.build has been found. + + rm (out_root / (*altn ? alt_src_root_file : std_src_root_file)); + } } setup_root (rs, false /* forwarded */); diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx index d229205..651b5c0 100644 --- a/bpkg/utility.cxx +++ b/bpkg/utility.cxx @@ -29,10 +29,14 @@ namespace bpkg const dir_path std_build_dir ("build"); const path std_bootstrap_file (dir_path (std_build_dir) /= "bootstrap.build"); const path std_root_file (dir_path (std_build_dir) /= "root.build"); + const dir_path std_bootstrap_dir (dir_path (std_build_dir) /= "bootstrap"); + const path std_src_root_file (std_bootstrap_dir / "src-root.build"); const dir_path alt_build_dir ("build2"); const path alt_bootstrap_file (dir_path (alt_build_dir) /= "bootstrap.build2"); const path alt_root_file (dir_path (alt_build_dir) /= "root.build2"); + const dir_path alt_bootstrap_dir (dir_path (alt_build_dir) /= "bootstrap"); + const path alt_src_root_file (alt_bootstrap_dir / "src-root.build2"); const dir_path current_dir ("."); diff --git a/bpkg/utility.hxx b/bpkg/utility.hxx index 597800c..34bda27 100644 --- a/bpkg/utility.hxx +++ b/bpkg/utility.hxx @@ -88,10 +88,14 @@ namespace bpkg extern const dir_path std_build_dir; // build/ extern const path std_bootstrap_file; // build/bootstrap.build extern const path std_root_file; // build/root.build + extern const dir_path std_bootstrap_dir; // build/bootstrap + extern const path std_src_root_file; // build/bootstrap/src-root.build extern const dir_path alt_build_dir; // build2/ extern const path alt_bootstrap_file; // build2/bootstrap.build2 extern const path alt_root_file; // build2/root.build2 + extern const dir_path alt_bootstrap_dir; // build2/bootstrap + extern const path alt_src_root_file; // build2/bootstrap/src-root.build2 extern const dir_path current_dir; // ./ -- cgit v1.1