Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Nov 2021 01:28:57 GMT
From:      Guangyuan Yang <ygy@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: f76516f11076 - main - Mk/Uses/go.mk: fix gomod-clean target when lang/go is not installed
Message-ID:  <202111070128.1A71SvcY031587@gitrepo.freebsd.org>

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

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

commit f76516f11076cb293ce87bccfc37797d82844063
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:26:02 +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
    MFH:            2021Q4
    Submitted by:   Rin Morningstar <ports.maintainer@evilphi.com>
    Reviewed by:    dmgk
    Differential Revision:  https://reviews.freebsd.org/D32054
---
 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?202111070128.1A71SvcY031587>