aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-25 11:20:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-25 11:20:33 +0200
commit7c97f36e205941163584484d2d933bf9cf41df47 (patch)
tree1e017e77eaaf580c1d8f75e967a5e14e6b594b8b
parentaec5f7309b2ee7210dc39de9c792f35273c73c10 (diff)
Create install.root instead of complaining if it doesn't exist
-rw-r--r--build2/install/rule.cxx17
1 files changed, 9 insertions, 8 deletions
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;
}