From dd608bb73b26180beb3f6077f88998b6422b1e18 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 16 Nov 2011 11:27:16 +0100 Subject: [PATCH] xbps-src: faster 'show-revdeps' impl for shlibs. --- xbps-src/shutils/show_revdeps.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/xbps-src/shutils/show_revdeps.sh b/xbps-src/shutils/show_revdeps.sh index 74d3109cdca..1d6a967a317 100644 --- a/xbps-src/shutils/show_revdeps.sh +++ b/xbps-src/shutils/show_revdeps.sh @@ -45,14 +45,17 @@ _show_shlib_pkg_deps() { local f j - for f in $(find ${XBPS_SRCPKGDIR} -type f -name *.rshlibs); do - for j in ${1}; do - if grep -q "$j" "$f"; then - revdepname=$(basename $f) - echo "${revdepname%.rshlibs}" - break - fi - done + revshlibs=$(grep "$1" ${XBPS_SRCPKGDIR}/*/*.rshlibs) + for f in ${revshlibs}; do + unset pkg revdepname tmprev + revdepname=$(basename "$f") + revdepname=${revdepname%.rshlibs*} + tmprev=$(echo "$revdepname"|sed 's/-//g') + eval pkg=\$pkg_"${tmprev}" + if [ -z "${pkg}" ]; then + eval local pkg_${tmprev}=1 + echo "$revdepname" + fi done } @@ -62,7 +65,7 @@ show_pkg_revdeps() [ -z "$1" ] && return 1 - shlibs=$(grep "$1" $SHLIBS_MAP) + shlibs=$(grep "$1" $SHLIBS_MAP|awk '{print $1}') if [ -n "$shlibs" ]; then # pkg provides shlibs _show_shlib_pkg_deps "$shlibs"