Hi, I am a maintainer of net/slackcat.

I am trying to cleanup about go.mod.  But I don't know how to fix go.mod, 
better.
So please review attached my patch.

I consider that there are some issues:
- When go.mod's directory set and run go tidy, then go.sum is update on same 
directory.
- go.mod and go.sum are required on fetch phase, so I can't override go.mod and 
go.sum.
- So above, no effect to patch for go.mod and go.sum.  But on build phase, 
required these.
- I want to update to golang.org/x/sys v0.6.0, but I still have some old 
versions of it on go.sum.  Really OK?  No problem?

I hope some features to net/slackcat.
- Add support golang.org/x/sys v0.6.0 and/or above.
- Add support minor updating some go modules.

P.S.
I think that I want ${FILESDIR}/go.{mod,sum} support and copy these to ${WRKDIR}
before fetch on USES=go:modules, so more cleanup this issue.  How about?
diff --git net/slackcat/Makefile net/slackcat/Makefile
index 5c46aab837b4..6ef12155fc38 100644
--- net/slackcat/Makefile
+++ net/slackcat/Makefile
@@ -1,8 +1,8 @@
 PORTNAME=      slackcat
 DISTVERSION=   1.7.3
-PORTREVISION=  13
+PORTREVISION=  14
 CATEGORIES=    net
-MASTER_SITES=  
https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/${DISTVERSIONFULL}/:gomod
+MASTER_SITES=  LOCAL/nork/${PORTNAME}-${DISTVERSION}:gomod
 DISTFILES=     go.mod:gomod
 
 MAINTAINER=    n...@freebsd.org
@@ -16,15 +16,13 @@ USES=               go:modules
 USE_GITHUB=    yes
 GH_ACCOUNT=    bcicen
 GH_TAGNAME=    5c4e4410002c
-GH_TUPLE=      golang:sys:v0.6.0:sys
 
 GO_MODULE=     github.com/${GH_ACCOUNT}/${GH_PROJECT}
 GO_BUILDFLAGS= -ldflags="-s -w -X main.version=${DISTVERSION} -X 
main.build=${GH_TAGNAME}"
 
 PLIST_FILES=   bin/slackcat
 
-pre-patch:
-       ${RM} -r ${WRKSRC}/vendor/golang.org/x/sys
-       ${LN} -s ${WRKDIR}/sys-* ${WRKSRC}/vendor/golang.org/x/sys
+post-extract:
+       @${CP} ${DISTDIR}/${DIST_SUBDIR}/go.mod ${WRKSRC}
 
 .include <bsd.port.mk>
diff --git net/slackcat/distinfo net/slackcat/distinfo
index d792dcc25f8f..f31adfaef6dc 100644
--- net/slackcat/distinfo
+++ net/slackcat/distinfo
@@ -1,7 +1,5 @@
-TIMESTAMP = 1679674827
-SHA256 (go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/go.mod) = 
98640a46a3b3a14c84f7df4e83548785e563c11de563893623766350452ce8e0
-SIZE (go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/go.mod) = 355
+TIMESTAMP = 1701933678
+SHA256 (go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/go.mod) = 
21b29c835b37d98997fd3bd980e9a6be32da8e7961db2043091e7c203f8dc329
+SIZE (go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/go.mod) = 484
 SHA256 
(go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/bcicen-slackcat-1.7.3-5c4e4410002c_GH0.tar.gz)
 = 680a799ad877d4165a84fc176bb4dc922e0f24ab4ff457715fe1bbefa3785ea2
 SIZE 
(go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/bcicen-slackcat-1.7.3-5c4e4410002c_GH0.tar.gz)
 = 28255
-SHA256 
(go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/golang-sys-v0.6.0_GH0.tar.gz)
 = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
-SIZE 
(go/net_slackcat/bcicen-slackcat-1.7.3-5c4e4410002c_GH0/golang-sys-v0.6.0_GH0.tar.gz)
 = 1434234
diff --git net/slackcat/files/patch-go.mod net/slackcat/files/patch-go.mod
deleted file mode 100644
index e63a547e5222..000000000000
--- net/slackcat/files/patch-go.mod
+++ /dev/null
@@ -1,24 +0,0 @@
---- go.mod.orig        2023-03-24 16:21:50 UTC
-+++ go.mod
-@@ -1,12 +1,19 @@
- module github.com/bcicen/slackcat
- 
--go 1.16
-+go 1.17
- 
- require (
-       github.com/BurntSushi/toml v0.3.0
-       github.com/fatih/color v1.5.0
--      github.com/mattn/go-colorable v0.1.8 // indirect
-       github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c
-       github.com/slack-go/slack v0.8.1
-       github.com/urfave/cli v1.20.0
-+)
-+
-+require (
-+      github.com/gorilla/websocket v1.4.2 // indirect
-+      github.com/mattn/go-colorable v0.1.8 // indirect
-+      github.com/mattn/go-isatty v0.0.12 // indirect
-+      github.com/pkg/errors v0.8.0 // indirect
-+      golang.org/x/sys v0.6.0 // indirect
- )
diff --git net/slackcat/files/patch-go.sum net/slackcat/files/patch-go.sum
deleted file mode 100644
index cc6feb500556..000000000000
--- net/slackcat/files/patch-go.sum
+++ /dev/null
@@ -1,8 +0,0 @@
---- go.sum.orig        2023-03-24 16:21:52 UTC
-+++ go.sum
-@@ -27,3 +27,5 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/n
- golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
- golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae 
h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
- golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod 
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
-+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git net/slackcat/files/patch-vendor_modules.txt 
net/slackcat/files/patch-vendor_modules.txt
deleted file mode 100644
index 5dd8396ec7b7..000000000000
--- net/slackcat/files/patch-vendor_modules.txt
+++ /dev/null
@@ -1,35 +0,0 @@
---- vendor/modules.txt.orig    2023-03-24 16:22:18 UTC
-+++ vendor/modules.txt
-@@ -5,19 +5,22 @@ github.com/BurntSushi/toml
- ## explicit
- github.com/fatih/color
- # github.com/gorilla/websocket v1.4.2
-+## explicit; go 1.12
- github.com/gorilla/websocket
- # github.com/mattn/go-colorable v0.1.8
--## explicit
-+## explicit; go 1.13
- github.com/mattn/go-colorable
- # github.com/mattn/go-isatty v0.0.12
-+## explicit; go 1.12
- github.com/mattn/go-isatty
- # github.com/pkg/errors v0.8.0
-+## explicit
- github.com/pkg/errors
- # github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c
- ## explicit
- github.com/skratchdot/open-golang/open
- # github.com/slack-go/slack v0.8.1
--## explicit
-+## explicit; go 1.13
- github.com/slack-go/slack
- github.com/slack-go/slack/internal/backoff
- github.com/slack-go/slack/internal/errorsx
-@@ -27,5 +30,6 @@ github.com/slack-go/slack/slackutilsx
- # github.com/urfave/cli v1.20.0
- ## explicit
- github.com/urfave/cli
--# golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
-+# golang.org/x/sys v0.6.0
-+## explicit; go 1.17
- golang.org/x/sys/unix

Attachment: OpenPGP_0x2D010D1315CC541F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to