aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-06-16 15:43:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-06-16 15:45:12 +0300
commit92697b523aa53d233c7ddd43c88d38f558fcd3bd (patch)
tree4e41e83366b6066966409e3b8000b59bcf496fb0
parent74f793789c96b91fec365f813efce234b92e2c03 (diff)
Fix failing for outdated src-root.build
-rw-r--r--bpkg/package-skeleton.cxx13
-rw-r--r--bpkg/utility.cxx4
-rw-r--r--bpkg/utility.hxx4
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<dir_path> (v) == src_root);
-#else
if (cast<dir_path> (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; // ./