Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2024 07:11:16 GMT
From:      Matthias Fechner <mfechner@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 30ee39816e4e - main - devel/gitlab-shell: fix build errors due to checksum failure
Message-ID:  <202404230711.43N7BGPO099036@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mfechner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=30ee39816e4e27529f1f2421820962b961c5fc0e

commit 30ee39816e4e27529f1f2421820962b961c5fc0e
Author:     Matthias Fechner <mfechner@FreeBSD.org>
AuthorDate: 2024-04-23 06:33:31 +0000
Commit:     Matthias Fechner <mfechner@FreeBSD.org>
CommitDate: 2024-04-23 07:10:37 +0000

    devel/gitlab-shell: fix build errors due to checksum failure
    
    The port will execute `go mod download` to download go modules.
    This command modifies the go.mod file which causes the checksum check to fail.
    Backup the go.mod and restore it afterwards.
    
    PR:             278520
---
 devel/gitlab-shell/Makefile | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/devel/gitlab-shell/Makefile b/devel/gitlab-shell/Makefile
index 461e78ca25c1..bc77ddea9f3a 100644
--- a/devel/gitlab-shell/Makefile
+++ b/devel/gitlab-shell/Makefile
@@ -38,17 +38,15 @@ DIST_SUBDIR=	go/${PKGORIGIN:S,/,_,g}/${DISTNAME}
 EXTRACT_ONLY+=	${DISTFILES:N*.mod\:*:N*.mod:C/:.*//}
 _USES_fetch+=	800:go-post-fetch
 go-post-fetch:
+	@${ECHO_MSG} "Copy go.mod as go mod download will modify it, which breaks checksum check"
+	@(cd ${DISTDIR}/${DIST_SUBDIR}; ${CP} go.mod go.mod.orig)
 	@${ECHO_MSG} "===> Fetching ${GO_MODNAME} dependencies";
 	@(cd ${DISTDIR}/${DIST_SUBDIR}; \
 		[ -e go.mod ] || ${RLN} ${GO_MODFILE} go.mod; \
 		${SETENV} ${GO_ENV} GOPROXY=${GO_GOPROXY} ${GO_CMD} mod download -x all)
+	@${ECHO_MSG} "Restore previous go.mod"
+	@(cd ${DISTDIR}/${DIST_SUBDIR}; ${MV} go.mod.orig go.mod)
 # ---------------------------
-# WARNING, maybe bug in core ports framework (work fine in the past for very long time
-# For an unkown reason, the downloaded go.mod is modified and therefor the distinfo is generated wrongly
-# Execute this, to fix it:
-# curl -v https://gitlab.com/gitlab-org/gitlab-shell/-/raw/v14.35.0/go.mod 2>&1 | grep content-length
-# curl -v https://gitlab.com/gitlab-org/gitlab-shell/-/raw/v14.35.0/go.mod | sha256
-# Correct this in distinfo
 
 VARLOGDIR=	/var/log/gitlab-shell
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404230711.43N7BGPO099036>