Allow passing -DDEPENDS_SHOW_FLAVOR to list flavors for dependency lists.

Submitted by:	se (based on D13535)
With hat:	portmgr
This commit is contained in:
Bryan Drewery 2018-01-24 18:54:57 +00:00
parent 5800e9be4e
commit 6339d61d4f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=459882
2 changed files with 15 additions and 5 deletions

View file

@ -6,11 +6,15 @@ set -e
. ${dp_SCRIPTSDIR}/functions.sh . ${dp_SCRIPTSDIR}/functions.sh
flavors=0
recursive=0 recursive=0
missing=0 missing=0
requires_wrkdir=0 requires_wrkdir=0
while getopts "mrw" FLAG; do while getopts "fmrw" FLAG; do
case "${FLAG}" in case "${FLAG}" in
f)
flavors=1
;;
m) m)
missing=1 missing=1
recursive=1 recursive=1
@ -71,14 +75,19 @@ check_dep() {
d=${d%@*} d=${d%@*}
;; ;;
esac esac
if [ ${flavors} -eq 1 -a -n "${FLAVOR:-}" ]; then
port_display="${d}@${FLAVOR}"
else
port_display="${d}"
fi
case " ${checked} " in case " ${checked} " in
*\ ${d}\ *) continue ;; # Already checked *\ ${d}\ *) continue ;; # Already checked
esac esac
checked="${checked} ${d}" checked="${checked} ${d}"
# Check if the dependency actually exists or skip otherwise. # Check if the dependency actually exists or skip otherwise.
if [ ! -d ${d} ]; then if [ ! -d "${d}" ]; then
echo "${dp_PKGNAME}: \"${d}\" non-existent -- dependency list incomplete" >&2 echo "${dp_PKGNAME}: \"${port_display}\" non-existent -- dependency list incomplete" >&2
continue continue
fi fi
@ -104,7 +113,7 @@ check_dep() {
if [ ${requires_wrkdir} -eq 1 ] && ! [ -d "${wrkdir}" ]; then if [ ${requires_wrkdir} -eq 1 ] && ! [ -d "${wrkdir}" ]; then
show_dep=0 show_dep=0
fi fi
[ ${show_dep} -eq 1 ] && echo ${d} [ ${show_dep} -eq 1 ] && echo "${port_display}"
if [ ${recursive} -eq 1 -o ${requires_wrkdir} -eq 1 -a ${show_dep} -eq 1 ]; then if [ ${recursive} -eq 1 -o ${requires_wrkdir} -eq 1 -a ${show_dep} -eq 1 ]; then
check_dep $@ check_dep $@
fi fi

View file

@ -4026,7 +4026,8 @@ DEPENDS-LIST= \
dp_PKGNAME="${PKGNAME}" \ dp_PKGNAME="${PKGNAME}" \
dp_PKG_INFO="${PKG_INFO}" \ dp_PKG_INFO="${PKG_INFO}" \
dp_SCRIPTSDIR="${SCRIPTSDIR}" \ dp_SCRIPTSDIR="${SCRIPTSDIR}" \
${SH} ${SCRIPTSDIR}/depends-list.sh ${SH} ${SCRIPTSDIR}/depends-list.sh \
${DEPENDS_SHOW_FLAVOR:D-f}
ALL-DEPENDS-LIST= ${DEPENDS-LIST} -r ${_UNIFIED_DEPENDS:Q} ALL-DEPENDS-LIST= ${DEPENDS-LIST} -r ${_UNIFIED_DEPENDS:Q}
MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q} MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q}