forked from stooke/macos-build-openjdk8u
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkwebrev.sh
executable file
·88 lines (76 loc) · 1.88 KB
/
mkwebrev.sh
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -e
jdk=jdk8u-dev
BUILD_DIR=`pwd`
REPO_DIR="$BUILD_DIR/$jdk"
pushd `dirname $0`
SCRIPT_DIR=`pwd`
popd
WEBREV_BASE="$BUILD_DIR/webrevs"
TOOL_DIR="$BUILD_DIR/tools"
. "$SCRIPT_DIR/tools.sh" "$TOOL_DIR" webrev mercurial
mkdir -p "$WEBREV_BASE"
repos="jdk hotspot corba nashorn langtools jaxp jaxws"
#repos=""
# NOTE: the sed RE is very different on a mac vs Linux!
mkwebrev() {
# $1 repo-dir $2 webrev-dir $3 CR#
RD=$1
WD=$2
CR=`echo $3 | sed -E 's/[^0-9]*([0-9]+)[^0-9]*.*/\1/g'`
pushd "$RD" >/dev/null
N=`hg status | wc -l`
if [ $N != 0 ] ; then
webrev.ksh -b -w -o "$WD" -c $CR
mv $WD/webrev/* $WD/webrev/..
rmdir $WD/webrev
else
echo " (no differences)"
fi
popd >/dev/null
}
mkrevs() {
# $1 CR $2 NUM
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
WEBREV_DIR="$WEBREV_BASE/jdk-$1/$2"
mkwebrev "$REPO_DIR" "$WEBREV_DIR/$2" $1
for a in $repos ; do
echo processing "$REPO_DIR/$a"
mkwebrev "$REPO_DIR/$a" "$WEBREV_DIR/$a.$2" $1
done
}
update() {
pushd "$REPO_DIR" >/dev/null
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
hg pull -u
for a in $repos ; do
cd $a
hg pull -u
cd ..
done
popd >/dev/null
}
clean() {
rm -fr "$REPO_DIR/build"
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
}
revert() {
pushd "$REPO_DIR" >/dev/null
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
hg revert .
for a in $repos ; do
cd $a
hg revert .
cd ..
done
popd >/dev/null
}
#revert
#update
#cd "$REPO_DIR/jdk"
#hg import -f --no-commit "$BUILD_DIR/8181872-jdk8.patch"
mkrevs 8144125-jdk8u 00