[Pkg-libvirt-commits] [libguestfs] 02/61: builder: allow the index parser to parse files with no sections

Hilko Bengen bengen at moszumanska.debian.org
Sat Mar 29 14:36:20 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 603ad40c5ac034f22f3f2f682755a871d9e84267
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Thu Mar 20 16:35:15 2014 +0100

    builder: allow the index parser to parse files with no sections
    
    Gracefully handle files with no sections; extend the validate.sh test
    to try to validate an empty file.
---
 builder/index-parse.y       | 2 ++
 builder/website/validate.sh | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/builder/index-parse.y b/builder/index-parse.y
index 9355bd4..5133959 100644
--- a/builder/index-parse.y
+++ b/builder/index-parse.y
@@ -108,6 +108,8 @@ sections:
         { $$ = $1; }
     | section EMPTY_LINE emptylines sections
         { $$ = $1; $$->next = $4; }
+    | emptylines
+        { $$ = NULL; }
 
 section:
       SECTION_HEADER fields
diff --git a/builder/website/validate.sh b/builder/website/validate.sh
index bd9a4ed..f2e24cf 100755
--- a/builder/website/validate.sh
+++ b/builder/website/validate.sh
@@ -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list