Skip to content

Commit

Permalink
builder: allow the index parser to parse files with no sections
Browse files Browse the repository at this point in the history
Gracefully handle files with no sections; extend the validate.sh test
to try to validate an empty file.
  • Loading branch information
ptoscano committed Mar 20, 2014
1 parent fa0fed8 commit 603ad40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builder/index-parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ sections:
{ $$ = $1; }
| section EMPTY_LINE emptylines sections
{ $$ = $1; $$->next = $4; }
| emptylines
{ $$ = NULL; }

section:
SECTION_HEADER fields
Expand Down
7 changes: 7 additions & 0 deletions builder/website/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
export LANG=C
set -e

fn=test-filename-for-index-validate

rm -f $fn
touch $fn

$VG ../virt-index-validate $srcdir/index
$VG ../virt-index-validate $srcdir/index.asc
$VG ../virt-index-validate $fn

rm $fn

0 comments on commit 603ad40

Please sign in to comment.