Skip to content

Commit

Permalink
Fix patching conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Chen committed Aug 17, 2019
1 parent 534f0da commit 47733f7
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ require (
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/Kubuxu/go-os-helper v0.0.1
github.com/Kubuxu/gocovmerge v0.0.0-20161216165753-7ecaa51963cd
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect
github.com/TRON-US/go-btfs-cmds v0.1.2
github.com/TRON-US/go-btfs-config v0.1.2
github.com/blang/semver v3.5.1+incompatible
github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/dustin/go-humanize v1.0.0
github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302
github.com/fatih/color v1.7.0 // indirect
Expand All @@ -30,7 +30,6 @@ require (
github.com/ipfs/go-cid v0.0.2
github.com/ipfs/go-cidutil v0.0.2
github.com/ipfs/go-datastore v0.0.5
github.com/ipfs/go-detect-race v0.0.1
github.com/ipfs/go-ds-badger v0.0.5
github.com/ipfs/go-ds-flatfs v0.0.2
github.com/ipfs/go-ds-leveldb v0.0.2
Expand Down Expand Up @@ -109,7 +108,6 @@ require (
github.com/opentracing/opentracing-go v1.1.0
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.3
github.com/prometheus/common v0.4.0
github.com/prometheus/procfs v0.0.0-20190519111021-9935e8e0588d // indirect
github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7
github.com/syndtr/goleveldb v1.0.0
Expand Down
12 changes: 7 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrU
github.com/Stebalien/go-bitfield v0.0.0-20180330043415-076a62f9ce6e/go.mod h1:3oM7gXIttpYDAJXpVNnSCiUMYBLIZ6cb1t+Ip982MRo=
github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo=
github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s=
github.com/TRON-US/go-btfs-config v0.1.1 h1:708pzBFKyxajfY4/yAExjxst/T0qZrJWTkBrtGSLOBw=
github.com/TRON-US/go-btfs-config v0.1.1/go.mod h1:GdZW7SmAY3rVqYwcbYkMmKo27IihzezwEQQMDTftlU0=
github.com/TRON-US/go-btfs-cmds v0.1.1 h1:q5yFG5kk3dV/LTq5aNaMkvNZiZL3cn7zJYeDKQoWox4=
github.com/TRON-US/go-btfs-cmds v0.1.1/go.mod h1:WxYDXVGY8q907Cz/45KsAwcBsAvkijclkIPbGyVpU9U=
github.com/TRON-US/go-btfs-cmds v0.1.2 h1:oAFOYHAfBlxPB+xiewDqOzbyPMmAbLQo63uu6gg61ZA=
github.com/TRON-US/go-btfs-cmds v0.1.2/go.mod h1:WxYDXVGY8q907Cz/45KsAwcBsAvkijclkIPbGyVpU9U=
github.com/TRON-US/go-btfs-config v0.1.2 h1:Ev2DEtZTl8TYJxNrPxf6jm5XYwDWd7R4+zyxh4DwP8g=
github.com/TRON-US/go-btfs-config v0.1.2/go.mod h1:GdZW7SmAY3rVqYwcbYkMmKo27IihzezwEQQMDTftlU0=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down Expand Up @@ -59,6 +59,8 @@ github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wX
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764=
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw=
github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
Expand Down Expand Up @@ -734,11 +736,11 @@ github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFd
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e h1:T5PdfK/M1xyrHwynxMIVMWLS7f/qHwfslZphxtGnw7s=
github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/tyler-smith/go-bip32 v0.0.0-20170922074101-2c9cfd177564 h1:NXXyQVeRVLK8Xu27/hkkjwVOZLk5v4ZBEvvMtqMqznM=
github.com/tyler-smith/go-bip32 v0.0.0-20170922074101-2c9cfd177564/go.mod h1:0/YuQQF676+d4CMNclTqGUam1EDwz0B8o03K9pQqA3c=
github.com/tyler-smith/go-bip39 v1.0.0 h1:FOHg9gaQLeBBRbHE/QrTLfEiBHy5pQ/yXzf9JG5pYFM=
github.com/tyler-smith/go-bip39 v1.0.0/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw=
Expand Down
36 changes: 18 additions & 18 deletions patches/test/interface-go-ipfs-core.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/tests/block.go b/tests/block.go
index 34e47e9..8bdabb1 100644
--- a/tests/block.go
+++ b/tests/block.go
@@ -111,7 +111,7 @@ func (tp *provider) TestBlockGet(t *testing.T) {
@@ -111,7 +111,7 @@ func (tp *TestSuite) TestBlockGet(t *testing.T) {
t.Error("didn't get correct data back")
}

Expand All @@ -15,7 +15,7 @@ diff --git a/tests/key.go b/tests/key.go
index 7ff5f33..e207fef 100644
--- a/tests/key.go
+++ b/tests/key.go
@@ -64,8 +64,8 @@ func (tp *provider) TestListSelf(t *testing.T) {
@@ -64,8 +64,8 @@ func (tp *TestSuite) TestListSelf(t *testing.T) {
t.Errorf("expected the key to be called 'self', got '%s'", keys[0].Name())
}

Expand All @@ -26,7 +26,7 @@ index 7ff5f33..e207fef 100644
}
}

@@ -134,8 +134,8 @@ func (tp *provider) TestGenerate(t *testing.T) {
@@ -134,8 +134,8 @@ func (tp *TestSuite) TestGenerate(t *testing.T) {
t.Errorf("expected the key to be called 'foo', got '%s'", k.Name())
}

Expand All @@ -37,7 +37,7 @@ index 7ff5f33..e207fef 100644
}
}

@@ -157,8 +157,8 @@ func (tp *provider) TestGenerateSize(t *testing.T) {
@@ -157,8 +157,8 @@ func (tp *TestSuite) TestGenerateSize(t *testing.T) {
t.Errorf("expected the key to be called 'foo', got '%s'", k.Name())
}

Expand All @@ -48,7 +48,7 @@ index 7ff5f33..e207fef 100644
}
}

@@ -256,13 +256,13 @@ func (tp *provider) TestList(t *testing.T) {
@@ -256,13 +256,13 @@ func (tp *TestSuite) TestList(t *testing.T) {
return
}

Expand All @@ -70,7 +70,7 @@ diff --git a/tests/name.go b/tests/name.go
index efaf1d3..db495c3 100644
--- a/tests/name.go
+++ b/tests/name.go
@@ -212,7 +212,7 @@ func (tp *provider) TestBasicPublishResolveKey(t *testing.T) {
@@ -212,7 +212,7 @@ func (tp *TestSuite) TestBasicPublishResolveKey(t *testing.T) {
t.Fatal(err)
}

Expand All @@ -83,7 +83,7 @@ diff --git a/tests/object.go b/tests/object.go
index 8682a2e..4f4fc25 100644
--- a/tests/object.go
+++ b/tests/object.go
@@ -89,15 +89,15 @@ func (tp *provider) TestObjectPut(t *testing.T) {
@@ -89,15 +89,15 @@ func (tp *TestSuite) TestObjectPut(t *testing.T) {
t.Fatal(err)
}

Expand All @@ -106,10 +106,10 @@ diff --git a/tests/path.go b/tests/path.go
index 4fd18bd..a876053 100644
--- a/tests/path.go
+++ b/tests/path.go
@@ -188,9 +188,9 @@ func (tp *provider) TestPathRoot(t *testing.T) {
@@ -188,9 +188,9 @@ func (tp *TestSuite) TestPathRoot(t *testing.T) {
}

func (tp *provider) TestPathJoin(t *testing.T) {
func (tp *TestSuite) TestPathJoin(t *testing.T) {
- p1 := path.New("/ipfs/QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6/bar/baz")
+ p1 := path.New("/btfs/QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6/bar/baz")

Expand All @@ -122,7 +122,7 @@ diff --git a/tests/unixfs.go b/tests/unixfs.go
index c810167..a791ec7 100644
--- a/tests/unixfs.go
+++ b/tests/unixfs.go
@@ -50,12 +50,12 @@ func (tp *provider) TestUnixfs(t *testing.T) {
@@ -50,12 +50,12 @@ func (tp *TestSuite) TestUnixfs(t *testing.T) {
t.Run("TestGetSeek", tp.TestGetSeek)
}

Expand All @@ -139,7 +139,7 @@ index c810167..a791ec7 100644

func strFile(data string) func() files.Node {
return func() files.Node {
@@ -170,20 +170,20 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -170,20 +170,20 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
{
name: "addCidV1",
data: strFile(helloStr),
Expand All @@ -163,7 +163,7 @@ index c810167..a791ec7 100644
opts: []options.UnixfsAddOption{options.Unixfs.Hash(mh.SHA3_256)},
},
{
@@ -196,38 +196,38 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -196,38 +196,38 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
{
name: "addInline",
data: strFile(helloStr),
Expand Down Expand Up @@ -209,7 +209,7 @@ index c810167..a791ec7 100644
opts: []options.UnixfsAddOption{options.Unixfs.Chunker("size-4"), options.Unixfs.Layout(options.TrickleLayout)},
},
// Local
@@ -247,26 +247,26 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -247,26 +247,26 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
{
name: "simpleDirNoWrap",
data: flatDir,
Expand Down Expand Up @@ -240,7 +240,7 @@ index c810167..a791ec7 100644
data: func() files.Node {
return files.NewBytesFile([]byte(helloStr))
},
@@ -285,26 +285,26 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -285,26 +285,26 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
},
wrap: "t",
expect: wrapped("t"),
Expand Down Expand Up @@ -271,7 +271,7 @@ index c810167..a791ec7 100644
opts: []options.UnixfsAddOption{options.Unixfs.Nocopy(true)},
err: helpers.ErrMissingFsRef.Error(),
},
@@ -312,7 +312,7 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -312,7 +312,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
{
name: "simpleAddEvent",
data: strFile(helloStr),
Expand All @@ -280,7 +280,7 @@ index c810167..a791ec7 100644
events: []coreiface.AddEvent{
{Name: "bafkreidi4zlleupgp2bvrpxyja5lbvi4mym7hz5bvhyoowby2qp7g2hxfa", Path: p("bafkreidi4zlleupgp2bvrpxyja5lbvi4mym7hz5bvhyoowby2qp7g2hxfa"), Size: strconv.Itoa(len(helloStr))},
},
@@ -321,7 +321,7 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -321,7 +321,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
{
name: "silentAddEvent",
data: twoLevelDir(),
Expand All @@ -289,7 +289,7 @@ index c810167..a791ec7 100644
events: []coreiface.AddEvent{
{Name: "abc", Path: p("QmU7nuGs2djqK99UNsNgEPGh6GV4662p6WtsgccBNGTDxt"), Size: "62"},
{Name: "", Path: p("QmVG2ZYCkV1S4TK8URA3a4RupBF17A8yAr4FqsRDXVJASr"), Size: "229"},
@@ -331,7 +331,7 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -331,7 +331,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
{
name: "dirAddEvents",
data: twoLevelDir(),
Expand All @@ -298,7 +298,7 @@ index c810167..a791ec7 100644
events: []coreiface.AddEvent{
{Name: "abc/def", Path: p("QmNyJpQkU1cEkBwMDhDNFstr42q55mqG5GE5Mgwug4xyGk"), Size: "13"},
{Name: "bar", Path: p("QmS21GuXiRMvJKHos4ZkEmQDmRBqRaF5tQS2CQCu2ne9sY"), Size: "14"},
@@ -345,7 +345,7 @@ func (tp *provider) TestAdd(t *testing.T) {
@@ -345,7 +345,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
data: func() files.Node {
return files.NewReaderFile(bytes.NewReader(bytes.Repeat([]byte{0}, 1000000)))
},
Expand Down
12 changes: 6 additions & 6 deletions patching.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ if ! patch -R -s -f --dry-run $patchdir/path.go < ./patches/go-path-v0.0.4-path.
patch $patchdir/path.go < ./patches/go-path-v0.0.4-path.go.patch;
fi

# patching $GOPATH/pkg/mod/github.com/ipfs/interface-go-ipfs-core@v0.0.8
# patching $GOPATH/pkg/mod/github.com/ipfs/interface-go-ipfs-core@v0.1.0
patchdir=$GOPATH/pkg/mod/github.com/ipfs/[email protected]
chmod -R 777 $patchdir
# 1) path.go
if ! patch -R -s -f --dry-run $patchdir/path/path.go < ./patches/interface-go-ipfs-core-v0.0.8-path.go.patch 1>/dev/null; then
patch $patchdir/path/path.go < ./patches/interface-go-ipfs-core-v0.0.8-path.go.patch;
if ! patch -R -s -f --dry-run $patchdir/path/path.go < ./patches/interface-go-ipfs-core-v0.1.0-path.go.patch 1>/dev/null; then
patch $patchdir/path/path.go < ./patches/interface-go-ipfs-core-v0.1.0-path.go.patch;
fi
# 2) errors.go
if ! patch -R -s -f --dry-run $patchdir/errors.go < ./patches/interface-go-ipfs-core-v0.0.8-errors.go.patch 1>/dev/null; then
patch $patchdir/errors.go < ./patches/interface-go-ipfs-core-v0.0.8-errors.go.patch;
if ! patch -R -s -f --dry-run $patchdir/errors.go < ./patches/interface-go-ipfs-core-v0.1.0-errors.go.patch 1>/dev/null; then
patch $patchdir/errors.go < ./patches/interface-go-ipfs-core-v0.1.0-errors.go.patch;
fi

# patching $GOPATH/pkg/mod/github.com/libp2p/[email protected]
Expand All @@ -48,7 +48,7 @@ if ! patch -R -s -f --dry-run $patchdir/record.go < ./patches/go-ipns-v.0.0.1-re
fi

# patching test
patchdir=$GOPATH/pkg/mod/github.com/ipfs/interface-go-ipfs-core@v0.0.8
patchdir=$GOPATH/pkg/mod/github.com/ipfs/interface-go-ipfs-core@v0.1.0
cp ./patches/test/interface-go-ipfs-core.patch $patchdir
cd $patchdir
if ! patch -p1 -R -s -f --dry-run < interface-go-ipfs-core.patch 1>/dev/null; then
Expand Down

0 comments on commit 47733f7

Please sign in to comment.