aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI <freebsd-bug-report-yf@yf.bsdclub.org>2024-05-16 11:19:29 +0000
committerMatthias Fechner <mfechner@FreeBSD.org>2024-05-21 12:59:11 +0000
commitc0d940d81130b3847fb4a997b491c7542c4e4b62 (patch)
treedf6268af99e4b97bfec38fc99470bd57b9e09cdb
parentbe21de60ad2f004438aee00c2d84d6b40c20f834 (diff)
downloadports-c0d940d81130b3847fb4a997b491c7542c4e4b62.tar.gz
ports-c0d940d81130b3847fb4a997b491c7542c4e4b62.zip
devel/gitlab-shell: fix build as non-root user in poudriere
PR: 278710 (cherry picked from commit 3c8fd2ac242ab03120b5d7eb4a02f84d346a0475)
-rw-r--r--devel/gitlab-shell/Makefile28
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>