From ad59fab667c469f928e8897a762b3d5f519aba82 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Feb 2019 13:04:50 +0200 Subject: Skip subdirs logic if installation path includes file name --- build2/install/rule.cxx | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index 5523a730..a30cbd33 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -621,10 +621,14 @@ namespace build2 dir_path d (n ? p->directory () : path_cast (*p)); install_dirs ids (resolve (f, d)); - if (auto l = f["install.subdirs"]) + + if (!n) { - if (cast (l)) - resolve_subdir (ids, f, f.base_scope (), l); + if (auto l = f["install.subdirs"]) + { + if (cast (l)) + resolve_subdir (ids, f, f.base_scope (), l); + } } return ids.back ().dir / (n ? p->leaf () : f.path ().leaf ()); @@ -868,12 +872,16 @@ namespace build2 // install_dirs ids (resolve (t, d)); - // Handle install.subdirs if one was specified. + // Handle install.subdirs if one was specified. Unless the target path + // includes the file name in which case we assume it's a "final" path. // - if (auto l = t["install.subdirs"]) + if (!n) { - if (cast (l)) - resolve_subdir (ids, t, t.base_scope (), l); + if (auto l = t["install.subdirs"]) + { + if (cast (l)) + resolve_subdir (ids, t, t.base_scope (), l); + } } // Create leading directories. Note that we are using the leading @@ -1135,10 +1143,13 @@ namespace build2 // Handle install.subdirs if one was specified. // - if (auto l = t["install.subdirs"]) + if (!n) { - if (cast (l)) - resolve_subdir (ids, t, t.base_scope (), l); + if (auto l = t["install.subdirs"]) + { + if (cast (l)) + resolve_subdir (ids, t, t.base_scope (), l); + } } // Remove extras and the target itself. -- cgit