forked from bittorrent/go-btfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patching.sh
executable file
·39 lines (34 loc) · 1.97 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
#!/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 -s -f --dry-run $patchdir/protocols.go < ./patches/go-multiaddr-v0.0.4-protocols.go.patch 1>/dev/null; then
patch $patchdir/protocols.go < ./patches/go-multiaddr-v0.0.4-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 -s -f --dry-run $patchdir/path.go < ./patches/go-path-v0.0.4-path.go.patch 1>/dev/null; then
patch $patchdir/path.go < ./patches/go-path-v0.0.4-path.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 -s -f --dry-run $patchdir/dht_bootstrap.go < ./patches/go-libp2p-kad-dht-v0.0.13-dht_bootstrap.go.patch 1>/dev/null; then
patch $patchdir/dht_bootstrap.go < ./patches/go-libp2p-kad-dht-v0.0.13-dht_bootstrap.go.patch;
fi
if ! patch -R -s -f --dry-run $patchdir/dht_net.go < ./patches/go-libp2p-kad-dht-dht_net.go.patch 1>/dev/null; then
patch $patchdir/dht_net.go < ./patches/go-libp2p-kad-dht-dht_net.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 -s -f --dry-run $patchdir/validator.go < ./patches/go-libp2p-record-v0.0.1-validator.go.patch 1>/dev/null; then
patch $patchdir/validator.go < ./patches/go-libp2p-record-v0.0.1-validator.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 -s -f --dry-run $patchdir/record.go < ./patches/go-ipns-v.0.0.1-record.go.patch 1>/dev/null; then
patch $patchdir/record.go < ./patches/go-ipns-v.0.0.1-record.go.patch;
fi