aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-04-22 20:56:13 +0800
committerbdrewery <bdrewery@FreeBSD.org>2014-04-22 20:56:13 +0800
commit0fbb992902112316297078bf38c5c2986a975821 (patch)
tree61b6c9b3db573a90ca7ed57e3dc9473f9e9df543 /Mk
parentcb08ec97e6d8336aed804c661e2057c36c538032 (diff)
downloadfreebsd-ports-graphics-0fbb992902112316297078bf38c5c2986a975821.tar.gz
freebsd-ports-graphics-0fbb992902112316297078bf38c5c2986a975821.tar.zst
freebsd-ports-graphics-0fbb992902112316297078bf38c5c2986a975821.zip
- For pkg run-depends dir listing, consider deps recursively.
pkg_install already did this. - Speedup the pkg_install run-depends listing by processing unique packages. With hat: portmgr Reported by: antoine
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Scripts/check-stagedir.sh28
1 files changed, 21 insertions, 7 deletions
diff --git a/Mk/Scripts/check-stagedir.sh b/Mk/Scripts/check-stagedir.sh
index 194826c7c2a..264e9bcdd26 100644
--- a/Mk/Scripts/check-stagedir.sh
+++ b/Mk/Scripts/check-stagedir.sh
@@ -169,11 +169,25 @@ fi
fi
} >${WRKDIR}/.mtree
+pkg_get_recursive_deps() {
+ echo "$@"
+ PKG_CHECKED="${PKG_CHECKED} $@"
+ for depends in $(${PKG_QUERY} '%do' $@ | sort -u); do
+ [ -z "${depends}" ] && return
+ case " ${PKG_CHECKED} " in
+ *\ ${depends}\ *) continue ;;
+ esac
+ pkg_get_recursive_deps "${depends}"
+ done
+}
+
### GATHER DIRS OWNED BY RUN-DEPENDS. WHY ARE WE SCREAMING?
: >${WRKDIR}/.run-depends-dirs
if [ -n "${WITH_PKGNG}" ]; then
- echo "${PACKAGE_DEPENDS}" | xargs ${PKG_QUERY} "%D" | \
- sed -e 's,/$,,' | sort -u >>${WRKDIR}/.run-depends-dirs
+ echo "${PACKAGE_DEPENDS}" | while read pkg; do \
+ PKG_CHECKED= pkg_get_recursive_deps "${pkg}"; done | sort -u | \
+ xargs ${PKG_QUERY} "%D" | sed -e 's,/$,,' | sort -u \
+ >>${WRKDIR}/.run-depends-dirs
else
# Evaluate ACTUAL-PACKAGE-DEPENDS
packagelist=
@@ -190,11 +204,11 @@ else
}
EOF
)
- echo "${package_depends}" | while read line; do
- ${PKG_QUERY} -f ${line%%:*} | \
- awk "${awk_script}" | \
- sed -e "/^[^/]/s,^,${LOCALBASE}/,"
- done | sort -u >>${WRKDIR}/.run-depends-dirs
+ echo "${package_depends}" | tr ' ' '\n' | cut -d : -f 1 | \
+ sort -u | xargs -n 1 ${PKG_QUERY} -f | \
+ awk "${awk_script}" | \
+ sed -e "/^[^/]/s,^,${LOCALBASE}/," | sort -u \
+ >>${WRKDIR}/.run-depends-dirs
fi
fi
unset PACKAGE_DEPENDS PKG_QUERY