-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathUpdate (Wine).sh
83 lines (69 loc) · 1.28 KB
/
Update (Wine).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
#!/bin/bash
# 12/17/2012 jichi
ME="$(basename "$0" .sh)"
cd "$(dirname "$0")"
MACPORTS_HOME=/opt/local
DARWINE_HOME=/Applications/Wine.app/Contents/Resources
export PATH=$PATH:$MACPORTS_HOME/bin:$DARWINE_HOME/bin
die()
{
>&2 echo "$@"
exit 1
}
require()
{
local i
for i; do
which "$i" >/dev/null 2>&1 || \
die "$ME: cannot find '$i' in PATH, ABORT"
done
}
require wine
WINE=wine
HG="$(PWD)/Update/mercurial/hg.exe"
HG="$(echo "z:$HG" | sed 's,/,\\\\,g')"
#HG="$WINE $HG" # does not work when there are spaces in HG orz
# Use native hg if find hg in PATH
#which hg >/dev/null 2>&1 && HG=hg
_hg() {
if $(which hg >/dev/null 2>&1); then
echo "$ME: using native hg in the PATH"
hg "$@"
else
$WINE "$HG" "$@"
fi
}
HG_OPT="-v --debug"
REPOS="\
. \
Frameworks/Python \
Frameworks/EB \
Frameworks/Sakura \
"
#die()
#{
# >&2 echo "$@"
# exit -1
#}
#
#require()
#{
# local i
# for i; do
# which "$i" >/dev/null 2>&1 || \
# die "$ME: cannot find '$i' in PATH, ABORT"
# done
#}
#require hg
test -e .hgignore || die "unknown hg repository"
for f in `echo $REPOS`; do
if [ -e "$f/.hgignore" ]; then
pushd "$f"
echo hg pullup: `pwd`
_hg $HG_OPT pull && \
_hg $HG_OPT up
popd
fi
done
test -x Deploy && rsync -av Deploy/* ..
# EOF