forked from bittorrent/go-btfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patching.sh
executable file
·57 lines (51 loc) · 2.86 KB
/
patching.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
#!/usr/bin/env bash
# patching $GOPATH/pkg/mod/github.com/multiformats/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/multiformats/[email protected]
chmod -R 777 $patchdir
if ! patch -R -p0 -s -f --dry-run $patchdir/protocols.go < ./patches/go-multiaddr-v0.0.1-protocols.go.patch; then
patch -p0 $patchdir/protocols.go < ./patches/go-multiaddr-v0.0.1-protocols.go.patch;
fi
# patching $GOPATH/pkg/mod/github.com/ipfs/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/ipfs/[email protected]
chmod -R 777 $patchdir
if ! patch -R -p0 -s -f --dry-run $patchdir/path.go < ./patches/go-path-v0.0.3-path.go.patch; then
patch -p0 $patchdir/path.go < ./patches/go-path-v0.0.3-path.go.patch;
fi
# patching $GOPATH/pkg/mod/github.com/ipfs/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/ipfs/[email protected]
chmod -R 777 $patchdir
# 1) path.go
if ! patch -R -p0 -s -f --dry-run $patchdir/path.go < ./patches/interface-go-ipfs-core-v0.0.6-path.go.patch; then
patch -p0 $patchdir/path.go < ./patches/interface-go-ipfs-core-v0.0.6-path.go.patch;
fi
# 2) errors.go
if ! patch -R -p0 -s -f --dry-run $patchdir/errors.go < ./patches/interface-go-ipfs-core-v0.0.6-errors.go.patch; then
patch -p0 $patchdir/errors.go < ./patches/interface-go-ipfs-core-v0.0.6-errors.go.patch;
fi
# patching $GOPATH/pkg/mod/github.com/libp2p/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/libp2p/[email protected]
chmod -R 777 $patchdir
if ! patch -R -p0 -s -f --dry-run $patchdir/dht_bootstrap.go < ./patches/go-libp2p-kad-dht-v0.0.7-dht_bootstrap.go.patch; then
patch -p0 $patchdir/dht_bootstrap.go < ./patches/go-libp2p-kad-dht-v0.0.7-dht_bootstrap.go.patch;
fi
# patching $GOPATH/pkg/mod/github.com/ipfs/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/ipfs/[email protected]
chmod -R 777 $patchdir
if ! patch -R -p0 -s -f --dry-run $patchdir/cli/parse.go < ./patches/go-ipfs-cmds-v0.0.5-cli-parse.go.patch; then
patch -p0 $patchdir/cli/parse.go < ./patches/go-ipfs-cmds-v0.0.5-cli-parse.go.patch;
fi
# patching $GOPATH/pkg/mod/github.com/ipfs/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/ipfs/[email protected]
chmod -R 777 $patchdir
# 1) patching init.go
if ! patch -R -p0 -s -f --dry-run $patchdir/init.go < ./patches/go-ipfs-config-v0.0.1-init.go.patch; then
patch -p0 $patchdir/init.go < ./patches/go-ipfs-config-v0.0.1-init.go.patch;
fi
# 2) patching config.go
if ! patch -R -p0 -s -f --dry-run $patchdir/config.go < ./patches/go-ipfs-config-v0.0.1-config.go.patch; then
patch -p0 $patchdir/config.go < ./patches/go-ipfs-config-v0.0.1-config.go.patch;
fi
# 3) patching bootstrap_peers.go
if ! patch -R -p0 -s -f --dry-run $patchdir/bootstrap_peers.go < ./patches/go-ipfs-config-v0.0.1-bootstrap_peers.go.patch; then
patch -p0 $patchdir/bootstrap_peers.go < ./patches/go-ipfs-config-v0.0.1-bootstrap_peers.go.patch;
fi