From 94b99c2a6c4ddaf29467df2adfb83f86ca60629e Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 17 Aug 2016 08:54:43 +0000 Subject: Unbreak make missing. Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D7504 --- Mk/Scripts/depends-list.sh | 18 +++++++++++++++++- Mk/bsd.port.mk | 10 ++++------ 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'Mk') diff --git a/Mk/Scripts/depends-list.sh b/Mk/Scripts/depends-list.sh index d2f26f1583e0..ebda54c674e1 100644 --- a/Mk/Scripts/depends-list.sh +++ b/Mk/Scripts/depends-list.sh @@ -7,9 +7,14 @@ set -e . ${dp_SCRIPTSDIR}/functions.sh recursive=0 +missing=0 requires_wrkdir=0 -while getopts "rw" FLAG; do +while getopts "mrw" FLAG; do case "${FLAG}" in + m) + missing=1 + recursive=1 + ;; r) recursive=1 ;; @@ -38,6 +43,10 @@ fi set -u +if [ ${missing} -eq 1 ]; then + existing=$(${dp_PKG_INFO} -aoq|paste -d ' ' -s -) +fi + check_dep() { local _dep wrkdir show_dep @@ -62,6 +71,13 @@ check_dep() { continue fi + # If only looking for missign, show if missing + if [ ${missing} -eq 1 ]; then + case " ${existing} " in + *\ ${d#${PORTSDIR}/}\ *) continue ;; # We have it, nothing to see + esac + fi + # Grab any needed vars from the port. if [ ${requires_wrkdir} -eq 1 -a ${recursive} -eq 1 ]; then diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index f3c43dc4a6c9..57a555e395d0 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -4007,10 +4007,12 @@ DEPENDS-LIST= \ PORTSDIR="${PORTSDIR}" \ dp_MAKE="${MAKE}" \ dp_PKGNAME="${PKGNAME}" \ + dp_PKG_INFO="${PKG_INFO}" \ dp_SCRIPTSDIR="${SCRIPTSDIR}" \ ${SH} ${SCRIPTSDIR}/depends-list.sh ALL-DEPENDS-LIST= ${DEPENDS-LIST} -r ${_UNIFIED_DEPENDS:Q} +MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q} TEST-DEPENDS-LIST= ${DEPENDS-LIST} ${TEST_DEPENDS:Q} CLEAN-DEPENDS-LIST= ${DEPENDS-LIST} -wr ${_UNIFIED_DEPENDS:Q} CLEAN-DEPENDS-LIMITED-LIST= ${DEPENDS-LIST} -w ${_UNIFIED_DEPENDS:Q} @@ -4290,12 +4292,8 @@ package-recursive: package # Show missing dependencies missing: - @_origins=$$(${PKG_INFO} -aoq); \ - for dir in $$(${ALL-DEPENDS-LIST}); do \ - _origin=$${dir##${PORTSDIR}/}; \ - if ! $$(${ECHO_CMD} $${_origins} | ${GREP} -q $${_origin}); then \ - ${ECHO_CMD} $${_origin}; \ - fi; \ + @for dir in $$(${MISSING-DEPENDS-LIST}); do \ + echo $${dir#${PORTSDIR}/}; \ done # Show missing dependencies by name -- cgit