[MLton-commit] r4282

Stephen Weeks MLton@mlton.org
Fri, 2 Dec 2005 10:10:43 -0800


Added a script that runs GNU sed.  This is necessary for FreeBSD,
where sed is different than gsed.  This allowed me to eliminate the
sole FreeBSD patch file, which was causing problems on Windows
platforms because the file name contains colons.  If we ever need file
names with colons in the future (hopefully not), we'll have to do
something to prevent Windows from seeing them.

----------------------------------------------------------------------

U   mlton/trunk/bin/make-pdf-guide
A   mlton/trunk/bin/msed
D   mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide

----------------------------------------------------------------------

Modified: mlton/trunk/bin/make-pdf-guide
===================================================================
--- mlton/trunk/bin/make-pdf-guide	2005-12-02 13:39:14 UTC (rev 4281)
+++ mlton/trunk/bin/make-pdf-guide	2005-12-02 18:10:42 UTC (rev 4282)
@@ -5,6 +5,7 @@
 name=`basename $0`
 dir=`dirname $0`
 src=`cd $dir/.. && pwd`
+bin="$src/bin"
 
 die () {
         echo >&2 "$1"
@@ -52,7 +53,7 @@
 s;<td colspan = 3;<td align = right;
 s;<img src=\"\(http://mlton.org[^>]*\)>;<img src="moin-www.png"><a href=\"\1>image</a>;g
 EOF
-	sed -f $script <$f >.tmp
+	$bin/msed -f $script <$f >.tmp
 	mv .tmp $f
 done
 

Added: mlton/trunk/bin/msed
===================================================================
--- mlton/trunk/bin/msed	2005-12-02 13:39:14 UTC (rev 4281)
+++ mlton/trunk/bin/msed	2005-12-02 18:10:42 UTC (rev 4282)
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+set -e
+
+die () {
+        echo $1 >&2
+        exit 1
+}
+
+if gsed --version >/dev/null 2>&1; then
+        sed='gsed'
+elif sed --version 2>&1 | grep -q GNU; then
+        sed=`which sed`
+else
+        die 'Can'\''t find GNU sed'
+fi
+
+exec $sed "$@"


Property changes on: mlton/trunk/bin/msed
___________________________________________________________________
Name: svn:executable
   + *

Deleted: mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide
===================================================================
--- mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide	2005-12-02 13:39:14 UTC (rev 4281)
+++ mlton/trunk/package/freebsd/files/patch-bin::make-pdf-guide	2005-12-02 18:10:42 UTC (rev 4282)
@@ -1,12 +0,0 @@
---- bin/make-pdf-guide.orig	Wed Nov 30 00:44:19 2005
-+++ bin/make-pdf-guide	Wed Nov 30 00:44:33 2005
-@@ -52,7 +52,7 @@
- s;<td colspan = 3;<td align = right;
- s;<img src=\"\(http://mlton.org[^>]*\)>;<img src="moin-www.png"><a href=\"\1>image</a>;g
- EOF
--	sed -f $script <$f >.tmp
-+	gsed -f $script <$f >.tmp
- 	mv .tmp $f
- done
- 
-