[MLton-commit] r4234
Stephen Weeks
MLton@mlton.org
Tue, 15 Nov 2005 17:29:36 -0800
Fixed viewsvn links to point at tagged release instead of trunk.
----------------------------------------------------------------------
U mlton/trunk/bin/grab-wiki
----------------------------------------------------------------------
Modified: mlton/trunk/bin/grab-wiki
===================================================================
--- mlton/trunk/bin/grab-wiki 2005-11-16 00:51:10 UTC (rev 4233)
+++ mlton/trunk/bin/grab-wiki 2005-11-16 01:29:35 UTC (rev 4234)
@@ -26,11 +26,11 @@
TIMEFORMAT=' Took %lR.'
base='http://mlton.org'
-version=`date +%Y%m%d`
-
index='.index'
script='.script'
tmp='.tmp'
+useLocal='true'
+version=`date +%Y%m%d`
cd "$src/doc/guide"
@@ -38,7 +38,9 @@
drop='\(Download\|.*MoinEditorBackup\|OldPages\|Preferences\|RecentChanges\|TemporaryBugExamples\|TemporaryUpload\|WikiSandBox\)'
-#if true; then (cd $HOME/mlton/guide-in && tar.write .) | tar.read; else
+if $useLocal; then
+ (cd $HOME/mlton/guide-in && tar.write .) | tar.read;
+else
echo "Getting index:"
lynx -dump "$base/Index?action=titleindex" | \
grep -v >$index -e '^$' -e "^$drop$"
@@ -55,7 +57,7 @@
for f in bottom email ftp news top www; do
wget -c $base/wiki/mlton/img/moin-$f.png
done
-#fi
+fi
echo "Fixing pages:"
@@ -80,6 +82,8 @@
s;<link[^>]* href *= *"[^"]*?action[^"]*">;;g
# Add version stamp in upper left.
s;<a class = mltona\(.*\)>MLton</a>;<a class = mltona\1>MLton $version</a>;
+# Replace ViewSVN references to trunk with references to release tag.
+s;\(<a href = \"http://mlton.org/cgi-bin/viewsvn\.cgi.*/mlton/\)trunk\([^>]*\)>;\1tags/on-$version-release\2>;g
# Fix wiki hrefs and srcs
s; \(href\|src\) *= *"\(/pages/[^"]*\)"; \1="$base\2";g
s; \(href\|src\) *= *"/\([^"]\+\)"; \1="\2";g