gen_contents_index: Improve parsing of packages file
authorIan Lynagh <igloo@earth.li>
Fri, 8 Apr 2011 18:48:26 +0000 (19:48 +0100)
committerIan Lynagh <igloo@earth.li>
Fri, 8 Apr 2011 20:10:00 +0000 (21:10 +0100)
We are now more lenient in parsing the packages file, and
we don't use any GNUisms. Based on a patch from Matthias Kilian.

libraries/gen_contents_index

index fcf30e3..04209fd 100644 (file)
@@ -7,7 +7,7 @@ HADDOCK_ARGS=
 case $* in
 --inplace)
     HADDOCK=../inplace/bin/haddock
-    for LIB in `grep '^libraries/[^ ]\+ \+- \+[^ ]\+ \+[^ ]\+ \+[^ ]\+' ../packages | sed -e 's#libraries/##' -e 's/ .*//'`
+    for LIB in `grep '^libraries/[^ ]*  *- ' ../packages | sed -e 's#libraries/##' -e 's/ .*//'`
     do
         HADDOCK_FILE="$LIB/dist-install/doc/html/$LIB/$LIB.haddock"
         if [ -f "$HADDOCK_FILE" ]