diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2018-01-25 02:54:57 +0800 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2018-01-25 02:54:57 +0800 |
commit | aa20385c0b5ace01bb9595f7fd4df258dccfba7b (patch) | |
tree | 2c64dd405a4864e85ba085e801f232af77641f40 /Mk | |
parent | dde963a80ca274084baa954780c80b0f2ba46540 (diff) | |
download | freebsd-ports-gnome-aa20385c0b5ace01bb9595f7fd4df258dccfba7b.tar.gz freebsd-ports-gnome-aa20385c0b5ace01bb9595f7fd4df258dccfba7b.tar.zst freebsd-ports-gnome-aa20385c0b5ace01bb9595f7fd4df258dccfba7b.zip |
Allow passing -DDEPENDS_SHOW_FLAVOR to list flavors for dependency lists.
Submitted by: se (based on D13535)
With hat: portmgr
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Scripts/depends-list.sh | 17 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/Mk/Scripts/depends-list.sh b/Mk/Scripts/depends-list.sh index 0d3945c85359..39a0c5656f50 100644 --- a/Mk/Scripts/depends-list.sh +++ b/Mk/Scripts/depends-list.sh @@ -6,11 +6,15 @@ set -e . ${dp_SCRIPTSDIR}/functions.sh +flavors=0 recursive=0 missing=0 requires_wrkdir=0 -while getopts "mrw" FLAG; do +while getopts "fmrw" FLAG; do case "${FLAG}" in + f) + flavors=1 + ;; m) missing=1 recursive=1 @@ -71,14 +75,19 @@ check_dep() { d=${d%@*} ;; esac + if [ ${flavors} -eq 1 -a -n "${FLAVOR:-}" ]; then + port_display="${d}@${FLAVOR}" + else + port_display="${d}" + fi case " ${checked} " in *\ ${d}\ *) continue ;; # Already checked esac checked="${checked} ${d}" # Check if the dependency actually exists or skip otherwise. - if [ ! -d ${d} ]; then - echo "${dp_PKGNAME}: \"${d}\" non-existent -- dependency list incomplete" >&2 + if [ ! -d "${d}" ]; then + echo "${dp_PKGNAME}: \"${port_display}\" non-existent -- dependency list incomplete" >&2 continue fi @@ -104,7 +113,7 @@ check_dep() { if [ ${requires_wrkdir} -eq 1 ] && ! [ -d "${wrkdir}" ]; then show_dep=0 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 check_dep $@ fi diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index c16ebed77c7a..b5b955e9979c 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -4026,7 +4026,8 @@ DEPENDS-LIST= \ dp_PKGNAME="${PKGNAME}" \ dp_PKG_INFO="${PKG_INFO}" \ 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} MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q} |