From 5a763a5552184090602f0a9303b9266f5412f020 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 23 Mar 2023 06:18:26 +0200 Subject: Add support for relocatable installation manifest --- libbuild2/install/rule.cxx | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'libbuild2/install/rule.cxx') 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 - static inline P - chroot_path (const scope& rs, const P& p) - { - if (const dir_path* d = cast_null (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 (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)); -- cgit v1.1