aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses
diff options
context:
space:
mode:
authorGuangyuan Yang <ygy@FreeBSD.org>2021-11-07 01:26:02 +0000
committerGuangyuan Yang <ygy@FreeBSD.org>2021-11-07 01:26:02 +0000
commitf76516f11076cb293ce87bccfc37797d82844063 (patch)
tree36b5c046c675ec96aebef35c62ea3e5514d8153c /Mk/Uses
parent86536a8e65c20a19d15201db4f659047268295b6 (diff)
downloadports-f76516f11076cb293ce87bccfc37797d82844063.tar.gz
ports-f76516f11076cb293ce87bccfc37797d82844063.zip
Mk/Uses/go.mk: fix gomod-clean target when lang/go is not installed
make distclean target will break when lang/go is not installed. This provides an informational feedback and skips the gomod-clean target if go executable is not available. PR: 258359 MFH: 2021Q4 Submitted by: Rin Morningstar <ports.maintainer@evilphi.com> Reviewed by: dmgk Differential Revision: https://reviews.freebsd.org/D32054
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/go.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk
index 81946128114a..32972c902342 100644
--- a/Mk/Uses/go.mk
+++ b/Mk/Uses/go.mk
@@ -215,8 +215,12 @@ do-test:
.if ${go_ARGS:Mmodules} && defined(GO_MODULE)
gomod-clean:
+.if exists(${GO_CMD})
@${ECHO_MSG} "===> Cleaning Go module cache"
@${SETENV} ${GO_ENV} ${GO_CMD} clean -modcache
+.else
+ @${ECHO_MSG} "===> Skipping since ${GO_CMD} is not installed"
+.endif
# Hook up to distclean
.if !target(post-clean) && !make(clean)