[MLton-commit] r5910
Matthew Fluet
fluet at mlton.org
Tue Aug 21 06:18:57 PDT 2007
Tweaks to grab-wiki and make-pdf-guide scripts.
For grab-wiki, save the date of the grab in MLTONWIKIVERSION and stamp
with the string "MLTONWIKIVERSION" in the upper left of pages and for
ViewSVN references, replace reference to "trunk" with
"on-MLTONWIKIVERSION-release".
For make-pdf-guide, replace the string "MLTONWIKIVERSION" with the
date from the file MLTONWIKIVERSION.
This should have the effect that only the pages that actually change
between runs of grab-wiki will need to be committed to SVN (rather
than all files, since all files were being stamped with the current
date).
----------------------------------------------------------------------
U mlton/trunk/bin/grab-wiki
U mlton/trunk/bin/make-pdf-guide
A mlton/trunk/doc/guide/MLTONWIKIVERSION
D mlton/trunk/doc/guide/VERSION
----------------------------------------------------------------------
Modified: mlton/trunk/bin/grab-wiki
===================================================================
--- mlton/trunk/bin/grab-wiki 2007-08-21 05:52:56 UTC (rev 5909)
+++ mlton/trunk/bin/grab-wiki 2007-08-21 13:18:56 UTC (rev 5910)
@@ -5,6 +5,7 @@
name=`basename "$0"`
dir=`dirname "$0"`
src=`cd "$dir/.." && pwd`
+bin="$src/bin"
die () {
echo >&2 "$1"
@@ -36,7 +37,7 @@
rm -f *
-drop='\(Download\|Experimental\|.*MoinEditorBackup\|OldPages\|Preferences\|RecentChanges\|TemporaryBugExamples\|TemporaryUpload\|WikiSandBox\)'
+drop='\(Download\|Experimental\|.*MoinEditorBackup\|OldPages\|PageSize\|Preferences\|RecentChanges\|TemporaryUpload\|WikiSandBox\)'
if $useLocal; then
(cd "$HOME/mlton/guide-in" && tar.write .) | tar.read;
@@ -62,7 +63,7 @@
echo "Fixing pages:"
# Eliminate ungrabbed pages from Index.
-grep -v "$drop" Index >"$tmp"
+grep -v ">$drop<" Index >"$tmp"
mv "$tmp" Index
wwwImg='<img src="moin-www.png" alt="[WWW]" height="11" width="11">'
@@ -81,9 +82,9 @@
s;<a[^>]* href *= *"[^"]*?action[^"]*">.*</a>;;g
s;<link[^>]* href *= *"[^"]*?action[^"]*">;;g
# Add version stamp in upper left.
-s;<a class = mltona\(.*\)>MLton</a>;<a class = mltona\1>MLton $version</a>;
+s;<a class = mltona\(.*\)>MLton</a>;<a class = mltona\1>MLton MLTONWIKIVERSION</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
+s;\(<a href = \"http://mlton.org/cgi-bin/viewsvn\.cgi[^>]*/mlton/\)trunk\([^>]*\)>;\1tags/on-MLTONWIKIVERSION-release\2>;g
# Fix wiki hrefs and srcs
s; \(href\|src\) *= *"\(/pages/[^"]*\)"; \1="$base\2";g
s; \(href\|src\) *= *"/\([^"]\+\)"; \1="\2";g
@@ -97,7 +98,7 @@
echo "$f"
head -n -19 <"$f" >"$tmp"
(
- sed -f "$script" <"$tmp"
+ "$bin/msed" -f "$script" <"$tmp"
echo '</body></html>'
) >"$f"
done
@@ -106,4 +107,4 @@
cp Home index.html
-echo $version > VERSION
+echo $version > MLTONWIKIVERSION
Modified: mlton/trunk/bin/make-pdf-guide
===================================================================
--- mlton/trunk/bin/make-pdf-guide 2007-08-21 05:52:56 UTC (rev 5909)
+++ mlton/trunk/bin/make-pdf-guide 2007-08-21 13:18:56 UTC (rev 5910)
@@ -30,7 +30,7 @@
script='.script'
titlepage='title.html'
tmp="/tmp/mlton-guide.$$"
-version=`cat $src/doc/guide/VERSION`
+version=`cat $src/doc/guide/MLTONWIKIVERSION`
rm -rf "$tmp"
mkdir "$tmp"
@@ -53,6 +53,7 @@
s;\(<div id="content"\);\1;
s;<td colspan = 3;<td align = right;
s;<img src=\"\(http://mlton.org[^>]*\)>;<img src="moin-www.png"><a href=\"\1>image</a>;g
+s;MLTONWIKIVERSION;$version;g
EOF
"$bin/msed" -f "$script" <"$f" >.tmp
mv .tmp "$f"
Copied: mlton/trunk/doc/guide/MLTONWIKIVERSION (from rev 5904, mlton/trunk/doc/guide/VERSION)
Deleted: mlton/trunk/doc/guide/VERSION
===================================================================
--- mlton/trunk/doc/guide/VERSION 2007-08-21 05:52:56 UTC (rev 5909)
+++ mlton/trunk/doc/guide/VERSION 2007-08-21 13:18:56 UTC (rev 5910)
@@ -1 +0,0 @@
-20070813
More information about the MLton-commit
mailing list