git: 2a039d20f859 - main - net-mgmt/check_nwc_health: Work around port scout failure

From: Craig Leres <leres_at_FreeBSD.org>
Date: Sat, 04 Jun 2022 17:53:47 UTC
The branch main has been updated by leres:

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

commit 2a039d20f859058d97089c6d5a8945d2304ecc64
Author:     Craig Leres <leres@FreeBSD.org>
AuthorDate: 2022-06-04 17:53:21 +0000
Commit:     Craig Leres <leres@FreeBSD.org>
CommitDate: 2022-06-04 17:53:21 +0000

    net-mgmt/check_nwc_health: Work around port scout failure
    
    Out of the blue (on 6-Apr-2022) pkg-fallout started objecting to
    an awk expression in a support script:
    
        /usr/bin/awk: syntax error in regular expression ^#! ?\/.*\/[a-z]{0,2}awk at 0
         source line number 44 source file ./subst
         context is
                /^#! ?\/.*\/[a-z]{0,2}awk/ {sub(/^#! ?\/.*\/[a-z]{0,2}awk/,"#! >>>  /usr/bin/awk") <<< ;}
        *** [check_nwc_health] Error code 2
    
    This only happens with 12.3 and the amd64 and arm64 architectures
    and I have never been able to reproduce the error in a poudriere
    jail.
    
    Remove the offending expression (which is not used by check_nwc_health).
    
    Reported by:    portscout
---
 net-mgmt/check_nwc_health/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net-mgmt/check_nwc_health/Makefile b/net-mgmt/check_nwc_health/Makefile
index 5f47bd9bc8be..0b73fe3d34e9 100644
--- a/net-mgmt/check_nwc_health/Makefile
+++ b/net-mgmt/check_nwc_health/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	check_nwc_health
 PORTVERSION=	10.1.0.3
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	https://labs.consol.de/assets/downloads/nagios/
 
@@ -27,5 +28,8 @@ PLIST_FILES=	libexec/check_nwc_health
 post-patch:
 	${REINPLACE_CMD} -e "s| /bin/sed| ${SED}|" -e "s| /bin/grep| ${GREP}|" \
 	    ${WRKSRC}/plugins-scripts/Makefile.in
+	# Remove unused expression that is problematic for pkg-fallout
+	# under 12.3 but causes no problems anywhere else
+	${REINPLACE_CMD} -e "/@AWK@/d" ${WRKSRC}/plugins-scripts/subst.in
 
 .include <bsd.port.mk>