summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2017-03-19 12:47:07 +0000
committerDavid Allsopp <david.allsopp@metastack.com>2017-04-13 14:17:28 +0200
commit03015766857e6f057b7c8f8150f451236c909d63 (patch)
tree3465b663442b7b5c97de9bdf9126e69409f1bf15 /tools
parent9f25a61171e5133ad7fcde7ced72b838b49cec9a (diff)
downloadocaml-03015766857e6f057b7c8f8150f451236c909d63.tar.gz
Fix \r problems on recent Cygwins
The Cygwin packages for awk, grep and sed were updated on 20 February 2017 so that they no longer automatically strip \r characters on binary mounts. This affects the OCaml build system in a few places, requiring the addition of a few tr calls. References: * https://cygwin.com/ml/cygwin/2017-02/msg00152.html * https://cygwin.com/ml/cygwin/2017-02/msg00189.html * https://cygwin.com/ml/cygwin/2017-02/msg00188.html
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-typo2
-rwxr-xr-xtools/make-version-header.sh4
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/check-typo b/tools/check-typo
index a19943a6c0..550ce2524a 100755
--- a/tools/check-typo
+++ b/tools/check-typo
@@ -159,7 +159,7 @@ IGNORE_DIRS="
ocamldoc/*|*/ocamldoc/*) rules="long-line,$rules";;
esac
- (cat "$f"; echo) \
+ (cat "$f" | tr -d '\r'; echo) \
| awk -v rules="$rules" -v svnrules="$svnrules" -v file="$f" \
'
function err(name, msg) {
diff --git a/tools/make-version-header.sh b/tools/make-version-header.sh
index 7b37298e44..ce3b70c67c 100755
--- a/tools/make-version-header.sh
+++ b/tools/make-version-header.sh
@@ -32,8 +32,8 @@
# be used.
case $# in
- 0) version="`ocamlc -v | sed -n -e 's/.*version //p'`";;
- 1) version="`sed -e 1q $1`";;
+ 0) version="`ocamlc -v | tr -d '\r' | sed -n -e 's/.*version //p'`";;
+ 1) version="`sed -e 1q $1 | tr -d '\r'`";;
*) echo "usage: make-version-header.sh [version-file]" >&2
exit 2;;
esac