-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch
executable file
·66 lines (62 loc) · 997 Bytes
/
fetch
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
#!/bin/rc
upstream=git://git.netsurf-browser.org
modules=( \
expat \
zlib \
libjpeg \
libpng \
libcss \
libdom \
libhubbub \
libnsbmp \
libnsgif \
libparserutils \
libsvgtiny \
libwapcaplet \
libnsutils \
libutf8proc \
libnspsl \
libnslog \
netsurf \
nsgenbind \
)
fn do {
cmd=$1
shift
for(m in $modules)@{
echo '==> '$m: git/$cmd $*
cd $m
git/$cmd $*
}
}
base=$portcode
switch($1){
case 'clone'
switch($2){
case ssh
portcode=git+ssh://[email protected]/netsurf-plan9
case http
portcode=https://github.com/netsurf-plan9
case *
>[1=2] echo fetch clone '[http|ssh]'
exit noproto
}
for(m in $modules)@{
echo '==> '$m
git/clone $portcode/$m.git
cd $m
echo '[remote "upstream"]' >> .git/config
echo ' url='$upstream/$m.git >> .git/config
git/branch -n -b origin/plan9 plan9
}
case 'sync-upstream'
do pull -f -b upstream/master -u upstream
case 'pull'
git/pull
do pull
case 'push'
do push
case 'do'
shift
do $*
}