Skip to content

Commit

Permalink
devel/gitlab-shell: fix build errors due to checksum failure
Browse files Browse the repository at this point in the history
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
(cherry picked from commit 30ee398)
  • Loading branch information
mfechner committed Apr 23, 2024
1 parent c3697f5 commit 1a4d01d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions devel/gitlab-shell/Makefile
Expand Up @@ -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

Expand Down

0 comments on commit 1a4d01d

Please sign in to comment.