aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/install/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-03-23 06:18:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-03-23 06:18:26 +0200
commit5a763a5552184090602f0a9303b9266f5412f020 (patch)
tree0cf1fb0189157c4d02976156007fe4ee6ad7f1d1 /libbuild2/install/rule.cxx
parentf62b8809d827a0474284e75ad5724cf201ed83b1 (diff)
Add support for relocatable installation manifest
Diffstat (limited to 'libbuild2/install/rule.cxx')
-rw-r--r--libbuild2/install/rule.cxx25
1 files changed, 7 insertions, 18 deletions
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index a3fa5ee..9f7eaac 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -755,24 +755,6 @@ namespace build2
return s;
}
- // Given an abolute path return its chroot'ed version, if any, accoring to
- // install.chroot.
- //
- template <typename P>
- static inline P
- chroot_path (const scope& rs, const P& p)
- {
- if (const dir_path* d = cast_null<dir_path> (rs["install.chroot"]))
- {
- dir_path r (p.root_directory ());
- assert (!r.empty ()); // Must be absolute.
-
- return *d / p.leaf (r);
- }
-
- return p;
- }
-
void file_rule::
install_d (const scope& rs,
const install_dir& base,
@@ -942,6 +924,13 @@ namespace build2
{
context& ctx (rs.ctx);
+ if (link_target.absolute () &&
+ cast_false<bool> (rs["install.relocatable"]))
+ {
+ fail << "absolute symlink target " << link_target.string ()
+ << " in relocatable installation";
+ }
+
dir_path chd (chroot_path (rs, base.dir));
path rell (relative (chd));