From: Ondrej Lichtner olichtne@redhat.com
The scheme allowed the existence of empty tasks, which would later cause an expcetion during the recipe execution.
This patch fixes the schema so that there is always at least one command in the schema. The solution isn't perfect since now the error reported is something like "expected element <run>" which isn't entirely true (for e.g. <config> can be found as well), but it will do for now.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- schema-recipe.rng | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/schema-recipe.rng b/schema-recipe.rng index c211b11..bd0a8df 100644 --- a/schema-recipe.rng +++ b/schema-recipe.rng @@ -65,30 +65,18 @@ </attribute> </optional>
- <interleave> - <optional> - <ref name="define"/> - </optional> - - <zeroOrMore> - <ref name="config"/> - </zeroOrMore> - <zeroOrMore> + <oneOrMore> + <choice> <ref name="run"/> - </zeroOrMore> - <zeroOrMore> + <ref name="config"/> <ref name="wait"/> - </zeroOrMore> - <zeroOrMore> <ref name="intr"/> - </zeroOrMore> - <zeroOrMore> <ref name="kill"/> - </zeroOrMore> - <zeroOrMore> <ref name="ctl_wait"/> - </zeroOrMore> - </interleave> + + <ref name="define"/> + </choice> + </oneOrMore> </element> </define>