aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbpkg/manifest.cxx13
-rw-r--r--tests/manifest/testscript18
2 files changed, 13 insertions, 18 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);
diff --git a/tests/manifest/testscript b/tests/manifest/testscript
index 50e7e51..ded4c57 100644
--- a/tests/manifest/testscript
+++ b/tests/manifest/testscript
@@ -1093,9 +1093,10 @@
\
EOF
- : no-accept-clause
+
+ : empty
:
- $* <<EOI 2>>EOE != 0
+ $* <<EOF >>EOF
: 1
name: foo
version: 2.0.0
@@ -1106,15 +1107,14 @@
{
prefer
{
- config.bar.frame=4016
}
+
+ accept (true)
}
\
- EOI
- stdin:13:1: error: accept clause expected instead of '}'
- EOE
+ EOF
- : empty
+ : no-accept-clause
:
$* <<EOI 2>>EOE != 0
: 1
@@ -1127,12 +1127,12 @@
{
prefer
{
-
+ config.bar.frame=4016
}
}
\
EOI
- stdin:11:1: error: buildfile fragment expected
+ stdin:13:1: error: accept clause expected instead of '}'
EOE
: enable-clause