From a1d00de1408b36b6b68d18d1c1e1fba7df1add49 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 2 Nov 2020 16:56:35 +0300 Subject: Set executable bit for ad hoc buildscript rule executable target on POSIX --- libbuild2/filesystem.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libbuild2/filesystem.cxx') diff --git a/libbuild2/filesystem.cxx b/libbuild2/filesystem.cxx index 0072408..fbe145c 100644 --- a/libbuild2/filesystem.cxx +++ b/libbuild2/filesystem.cxx @@ -297,4 +297,30 @@ namespace build2 // return rmdir (ctx, d, verbosity); } + + permissions + path_perms (const path& p) + { + try + { + return path_permissions (p); + } + catch (const system_error& e) + { + fail << "unable to obtain path " << p << " permissions: " << e << endf; + } + } + + void + path_perms (const path& p, permissions f) + { + try + { + path_permissions (p, f); + } + catch (const system_error& e) + { + fail << "unable to set path " << p << " permissions: " << e; + } + } } -- cgit v1.1