Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Nov 2021 01:30:00 GMT
From:      Guangyuan Yang <ygy@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 3271400a5e29 - 2021Q4 - Mk/Uses/go.mk: fix gomod-clean target when lang/go is not installed
Message-ID:  <202111070130.1A71U0rS031793@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q4 has been updated by ygy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3271400a5e29ce317d8bf66d395c0a4f2a8c0874

commit 3271400a5e29ce317d8bf66d395c0a4f2a8c0874
Author:     Guangyuan Yang <ygy@FreeBSD.org>
AuthorDate: 2021-11-07 01:26:02 +0000
Commit:     Guangyuan Yang <ygy@FreeBSD.org>
CommitDate: 2021-11-07 01:29:54 +0000

    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
    Submitted by:   Rin Morningstar <ports.maintainer@evilphi.com>
    Reviewed by:    dmgk
    Differential Revision:  https://reviews.freebsd.org/D32054
    
    (cherry picked from commit f76516f11076cb293ce87bccfc37797d82844063)
---
 Mk/Uses/go.mk | 4 ++++
 1 file changed, 4 insertions(+)

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)



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