From e9e9c5c20f70367ce33e023455c7080186e615e2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Oct 2022 12:20:27 +0200 Subject: Improve diagnostics --- libbuild2/install/rule.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbuild2/install/rule.cxx') diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx index 756d5a8..9f01578 100644 --- a/libbuild2/install/rule.cxx +++ b/libbuild2/install/rule.cxx @@ -697,6 +697,10 @@ namespace build2 bool n (!p->to_directory ()); dir_path d (n ? p->directory () : path_cast (*p)); + if (n && d.empty ()) + fail << "relative installation file path '" << p + << "' has no directory component"; + install_dirs ids (resolve (f, d)); if (!n) @@ -997,6 +1001,10 @@ namespace build2 bool n (!p.to_directory ()); dir_path d (n ? p.directory () : path_cast (p)); + if (n && d.empty ()) + fail << "relative installation file path '" << p + << "' has no directory component"; + // Resolve target directory. // install_dirs ids (resolve (t, d)); @@ -1296,6 +1304,10 @@ namespace build2 bool n (!p.to_directory ()); dir_path d (n ? p.directory () : path_cast (p)); + if (n && d.empty ()) + fail << "relative installation file path '" << p + << "' has no directory component"; + // Resolve target directory. // install_dirs ids (resolve (t, d)); -- cgit v1.1