-
Notifications
You must be signed in to change notification settings - Fork 3
/
patch
executable file
·49 lines (43 loc) · 1.01 KB
/
patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
if test -z "$HOL2DK_DIR"
then
echo "HOL2DK_DIR is not set"
exit 1
fi
if test -z "$HOLLIGHT_DIR"
then
echo "HOLLIGHT_DIR is not set"
exit 1
fi
if test $# -ne 0
then
echo "usage: `basename $0`"
echo "patch the HOL-Light sources in $HOLLIGHT_DIR"
exit 1
fi
patch() {
if test -f $HOLLIGHT_DIR/$1-bak.ml
then
echo "$HOLLIGHT_DIR/$1-bak.ml already exists"
exit 1
else
echo "cp $HOLLIGHT_DIR/$1.ml $HOLLIGHT_DIR/$1-bak.ml"
cp $HOLLIGHT_DIR/$1.ml $HOLLIGHT_DIR/$1-bak.ml
echo "patch $HOLLIGHT_DIR/$1.ml ..."
sed -e 's/.*REMOVE.*//' -e 's/open Lib/needs "lib.ml";;/' $HOL2DK_DIR/$1.ml > $HOLLIGHT_DIR/$1.ml
fi
}
create() {
if test -f $HOLLIGHT_DIR/$1.ml
then
echo "$HOLLIGHT_DIR/$1.ml already exists"
exit 1
else
echo "create $HOLLIGHT_DIR/$1.ml ..."
sed -e 's/.*REMOVE.*//' -e 's/^open .*//' $HOL2DK_DIR/$1.ml > $HOLLIGHT_DIR/$1.ml
fi
}
patch fusion
patch bool
patch equal
create xnames