diff options
author | Yasuhito FUTATSUKI <freebsd-bug-report-yf@yf.bsdclub.org> | 2024-05-16 11:19:29 +0000 |
---|---|---|
committer | Matthias Fechner <mfechner@FreeBSD.org> | 2024-05-17 06:42:56 +0000 |
commit | 3c8fd2ac242ab03120b5d7eb4a02f84d346a0475 (patch) | |
tree | 605346de27197d907228fd765403de8c78d1e7fd /devel/gitlab-shell | |
parent | 8b13f6cf513c67acad3feb3d7f1dc7767a4e2fa0 (diff) | |
download | ports-3c8fd2ac242ab03120b5d7eb4a02f84d346a0475.tar.gz ports-3c8fd2ac242ab03120b5d7eb4a02f84d346a0475.zip |
devel/gitlab-shell: fix build as non-root user in poudriere
PR: 278710
Diffstat (limited to 'devel/gitlab-shell')
-rw-r--r-- | devel/gitlab-shell/Makefile | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/devel/gitlab-shell/Makefile b/devel/gitlab-shell/Makefile index 7936f330b809..e58abc4d9107 100644 --- a/devel/gitlab-shell/Makefile +++ b/devel/gitlab-shell/Makefile @@ -39,14 +39,17 @@ 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) + @if [ ! -e ${DISTDIR}/${DIST_SUBDIR}/.go-post-fetch-done ]; then\ + ${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) ;\ + ${TOUCH} ${DISTDIR}/${DIST_SUBDIR}/.go-post-fetch-done;\ + fi; # --------------------------- VARLOGDIR= /var/log/gitlab-shell @@ -82,4 +85,11 @@ post-install: ${SED} -E -e '/sample$$/ s#^#@sample #; \ s#${DATADIR_REL}/bin#@(,,555) ${DATADIR_REL}/bin#; ' >> ${TMPPLIST} -.include <bsd.port.mk> +go-pre-delete-distfiles: + @if [ -e ${DISTDIR}/${DIST_SUBDIR}/.go-post-fetch-done ]; then\ + ${RM} ${DISTDIR}/${DIST_SUBDIR}/.go-post-fetch-done || ${TRUE};\ + fi + +.include <bsd.port.pre.mk> +delete-distfiles: go-pre-delete-distfiles +.include <bsd.port.post.mk> |