[vala-tests] update-from-wiki: take pages as arguments, and wiki changes fix



commit 34c0a527251ccdff7ef9c5bdec9816bcf43bb451
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Thu Mar 18 00:53:04 2010 +0100

    update-from-wiki: take pages as arguments, and wiki changes fix

 update-from-wiki.sh |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/update-from-wiki.sh b/update-from-wiki.sh
index 75b8f73..1e19d3a 100755
--- a/update-from-wiki.sh
+++ b/update-from-wiki.sh
@@ -1,7 +1,8 @@
 #!/bin/bash
 
-PAGE="
+PAGES="
 BasicSample
+CharacterSample
 AdvancedSample
 ValueSample
 ListSample
@@ -11,7 +12,11 @@ PropertiesSample
 PreprocessorSample
 "
 
-for page in $PAGE ; do
+if [ "$#" != "0" ]; then
+  PAGES="$@"
+fi
+
+for page in $PAGES ; do
   url="http://live.gnome.org/Vala/$page";
   curl -s "$url?action=raw" -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" > "$page-raw"
 
@@ -24,16 +29,17 @@ for page in $PAGE ; do
       if [[ "$line" =~ vala-test:([-a-zA-Z0-9\.\/]*) ]] ; then
 	  file="tests/${BASH_REMATCH[1]}"
 	  echo "Updating $file..."
-	  > "$file"
 	  echo "
 // $url vala-test:${BASH_REMATCH[1]}
-" >> "$file"
-      elif [[ "$line" =~ }}} ]] ; then
+" > "$file"
+      elif [[ "$line" =~ '{{{' ]] ; then
+          continue
+      elif [[ "$line" =~ '}}}' ]] ; then
 	  file=
       elif [[ "$file" != "" ]] ; then
 	  echo "$line" >> "$file"
       fi
   done < "$page-raw"
 
-  rm -f "$page-raw"
+  rm "$page-raw"
 done



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]