aboutsummaryrefslogtreecommitdiff
path: root/libbpkg
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-06-14 17:27:41 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-06-14 17:27:41 +0300
commit9c476d4b12ba91677716fdcadfc14a5fc9859d5d (patch)
treed7e8c8cce9e8b4fa24494307eefd5a64e4515f22 /libbpkg
parent3bd7d2ec3004471e360910124e8d23aefbea4e96 (diff)
Allow empty prefer, require, and reflect buildfile clauses for dependencies
Diffstat (limited to 'libbpkg')
-rw-r--r--libbpkg/manifest.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx
index 35c1217..9578977 100644
--- a/libbpkg/manifest.cxx
+++ b/libbpkg/manifest.cxx
@@ -2155,7 +2155,9 @@ namespace bpkg
// curly braces (expected to be on the separate lines) and return
// the enclosed fragment.
//
- auto parse_block = [&t, &tt, &expect_token, &bad_token, this] ()
+ // Note that an empty buildfile fragment is allowed.
+ //
+ auto parse_block = [&t, &tt, &expect_token, this] ()
{
next (t, tt);
expect_token (type::newline);
@@ -2168,14 +2170,7 @@ namespace bpkg
next_block (t, tt);
- string r (move (t.value));
-
- // Fail if the buildfile fragment is empty.
- //
- if (r.find_first_not_of (" \t\n") == string::npos)
- bad_token ("buildfile fragment");
-
- return r;
+ return move (t.value);
};
const string& v (t.value);