From 96f2131e593e206f0e458409f22adfff8c1b5356 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2016 15:59:06 +0200 Subject: Clean up variable usage --- build2/install/module.cxx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'build2/install/module.cxx') diff --git a/build2/install/module.cxx b/build2/install/module.cxx index 3890901..0c17c05 100644 --- a/build2/install/module.cxx +++ b/build2/install/module.cxx @@ -77,21 +77,23 @@ namespace build2 } static void - set_dir (bool s, // specified - scope& r, // root scope - const char* n, // var name - const string& ps, // path (as string) - const string& fm = string (), // file mode - const string& dm = string (), // dir mode - const string& c = string (), // command - bool o = false) // override + set_dir (bool s, // specified + scope& r, // root scope + const char* n, // var name + const string& ps, // path (as string) + const string& fm = string (), // file mode + const string& dm = string (), // dir mode + const build2::path& c = build2::path (), // command + bool o = false) // override { + using build2::path; + dir_path p (ps); set_var (s, r, n, "", p.empty () ? nullptr : &p, o); set_var (s, r, n, ".mode", fm.empty () ? nullptr : &fm); set_var (s, r, n, ".dir_mode", dm.empty () ? nullptr : &dm); set_var (s, r, n, ".sudo", nullptr); - set_var (s, r, n, ".cmd", c.empty () ? nullptr : &c); + set_var (s, r, n, ".cmd", c.empty () ? nullptr : &c); set_var (s, r, n, ".options", nullptr); } @@ -153,22 +155,24 @@ namespace build2 // if (first) { + using build2::path; + bool s (config::specified (r, "config.install")); const string& n (cast (r["project"])); - set_dir (s, r, "root", "", "", "755", "install"); + set_dir (s, r, "root", "", "", "755", path ("install")); set_dir (s, r, "data_root", "root", "644"); set_dir (s, r, "exec_root", "root", "755"); set_dir (s, r, "sbin", "exec_root/sbin"); set_dir (s, r, "bin", "exec_root/bin"); set_dir (s, r, "lib", "exec_root/lib"); - set_dir (s, r, "libexec", "exec_root/libexec/" + n, "", "", "", true); + set_dir (s, r, "libexec", "exec_root/libexec/" + n, "", "", path (), true); - set_dir (s, r, "data", "data_root/share/" + n, "", "", "", true); + set_dir (s, r, "data", "data_root/share/" + n, "", "", path (), true); set_dir (s, r, "include", "data_root/include"); - set_dir (s, r, "doc", "data_root/share/doc/" + n, "", "", "", true); + set_dir (s, r, "doc", "data_root/share/doc/" + n, "", "", path (), true); set_dir (s, r, "man", "data_root/share/man"); set_dir (s, r, "man1", "man/man1"); -- cgit v1.1