Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

script to automate patch + promote

  • Loading branch information...
commit ac831da68483daf1c3c86176ac323a3adcedf904 1 parent 603e7f1
Jake Donham authored
Showing with 53 additions and 0 deletions.
  1. +53 −0 patch.sh
53 patch.sh
View
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+printf "%s" "Checking for patch directory... "
+patchdir=`dirname $0`
+if grep -q backtrace $patchdir/README; then
+ echo "found"
+else
+ echo "not found"
+ echo "It doesn't look like your patch directory is complete."
+ echo "Please follow the instructions in the README."
+ exit 1
+fi
+
+printf "%s" "Checking for OCaml source... "
+if [ -f VERSION ]; then
+ echo "found"
+ src_version=`head -1 VERSION`
+else
+ echo "not found"
+ echo "This doesn't look like an OCaml source tree."
+ echo "Please follow the instructions in the README."
+ exit 1
+fi
+
+printf "%s" "Checking OCaml version... "
+case $src_version in
+ 3.10.0|3.10.1|3.10.2)
+ echo "$src_version ok"
+ src_version=3.10.2
+ ;;
+ 3.11.0|3.11.1)
+ echo "$src_version ok"
+ src_version=3.11.1
+ ;;
+ 3.11.2)
+ echo "$src_version ok"
+ src_version=3.11.2
+ ;;
+ *)
+ echo "unsupported version $src_version"
+ echo "Sorry."
+ exit 1
+esac
+
+printf "%s" "Patching source and promoting..."
+
+./configure 2>&1 | awk -W interactive '{ if (x++ % 10 == 0) printf "." }'
+patch -p1 < $patchdir/patch-$src_version >/dev/null 2>&1
+make core promote 2>&1 | awk -W interactive '{ if (x++ % 10 == 0) printf "." }'
+patch -p1 < $patchdir/patch2-$src_version >/dev/null 2>&1
+
+echo " done!"
+echo "Now build OCaml as usual."
Please sign in to comment.
Something went wrong with that request. Please try again.