In security/qdigidoc4, I see debug-qt6-qttools being fetched but not
installed (given qt6-qttools is not yet installed).
I can reproduce this with:
# pkg_delete qt6-qttools
$ make DEBUG_PACKAGES='' INSTALL_DEBUG_PACKAGES=No
Somehow the expression `${DEBUG_PACKAGES:M${_S}}' (select all elements
patching the pattern) with DEBUG_PACKAGES being the empty string and
_S being "-" (from MULTI_PACKAGES) evaluates to true.
Wrapping it in !empty() behaves as expected and stops fetching debug-*.
Feedback? Objection? OK?
Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1581
diff -u -p -r1.1581 bsd.port.mk
--- bsd.port.mk 16 Nov 2022 17:42:18 -0000 1.1581
+++ bsd.port.mk 23 Dec 2022 09:26:34 -0000
@@ -988,7 +988,7 @@ _PACKAGE_LINKS += ${MACHINE_ARCH}/ftp/${
_PACKAGE_COOKIES += ${_PACKAGE_COOKIES${_S}}
_PACKAGE_COOKIE += ${_PACKAGE_COOKIE${_S}}
PKGFILE${_S} = ${_PKG_REPO}${_PKGFILE${_S}}
-. if ${DEBUG_PACKAGES:M${_S}}
+. if !empty(${DEBUG_PACKAGES:M${_S}})
_PACKAGE_COOKIES += ${_DBG_PACKAGE_COOKIE${_S}}
. if ${PERMIT_PACKAGE${_S}:L} == "yes"
_PACKAGE_COOKIES${_S} +=
${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp/${_DBG_PKGFILE${_S}}
@@ -1201,7 +1201,7 @@ PKG_ARGS${_S} += -A'${PKG_ARCH${_S}}'
_pkg${_S} = ${_PKGFILE${_S}}
_pkg_cookie${_S} = ${_PACKAGE_COOKIE${_S}}
-. if ${DEBUG_PACKAGES:M${_S}}
+. if !empty(${DEBUG_PACKAGES:M${_S}})
_DBG_PKG_ARGS${_S} := ${PKG_ARGS${_S}}
_DBG_PKG_ARGS${_S} += -P${FULLPKGPATH${_S}}:=:${FULLPKGNAME${_S}}
_DBG_PKG_ARGS${_S} += -DCOMMENT="debug info for ${PKGSTEM${_S}}"
@@ -2013,7 +2013,7 @@ _update_plist += `SUBPACKAGE=$i make run
_build_debug_info = PORTSDIR=${PORTSDIR} ${_PERLSCRIPT}/build-debug-info -P
${_WRKDEBUG} --
.for i in ${BUILD_PACKAGES}
-. if ${DEBUG_PACKAGES:M$i}
+. if !empty(${DEBUG_PACKAGES:M$i})
_build_debug_info += ${PKG_ARGS$i} ${FULLPKGNAME$i}
. endif
.endfor