From 7c97f36e205941163584484d2d933bf9cf41df47 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jan 2016 11:20:33 +0200 Subject: Create install.root instead of complaining if it doesn't exist --- build2/install/rule.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'build2') diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index b53ad59..1b08b16 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -329,15 +329,7 @@ namespace build2 install_dir r; if (d.absolute ()) - { d.normalize (); - - // Make sure it already exists (this will normally be - // install.root with everything else defined in term of it). - // - if (!dir_exists (d)) - fail << "installation directory " << d << " does not exist"; - } else { // If it is relative, then the first component is treated @@ -379,6 +371,15 @@ namespace build2 if (r.mode.empty ()) r.mode = "644"; if (r.dir_mode.empty ()) r.dir_mode = "755"; + // If the directory still doesn't exist, then this means it was specified + // as absolute (it will normally be install.root with everything else + // defined in term of it). We used to fail in this case but that proved + // to be just too anal. So now we just create it. + // + if (!dir_exists (r.dir)) + install (r, r.dir); // install -d + // fail << "installation directory " << d << " does not exist"; + return r; } -- cgit v1.1