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/utility.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbuild2/install/utility.hxx') diff --git a/libbuild2/install/utility.hxx b/libbuild2/install/utility.hxx index 530a9d7..7ab8114 100644 --- a/libbuild2/install/utility.hxx +++ b/libbuild2/install/utility.hxx @@ -86,6 +86,18 @@ namespace build2 // LIBBUILD2_SYMEXPORT path resolve_file (const file&); // rule.cxx + + // Given an abolute path return its chroot'ed version, if any, accoring to + // install.chroot. + // + template + inline P + chroot_path (const scope& rs, const P& p) + { + assert (p.absolute ()); + const dir_path* d (cast_null (rs["install.chroot"])); + return d != nullptr ? *d / p.leaf (p.root_directory ()) : p; + } } } -- cgit v1.1