diff --git a/xbps-src/shutils/show_revdeps.sh b/xbps-src/shutils/show_revdeps.sh index dcc3b1abe85..74d3109cdca 100644 --- a/xbps-src/shutils/show_revdeps.sh +++ b/xbps-src/shutils/show_revdeps.sh @@ -23,11 +23,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #- -show_pkg_revdeps() +_show_hard_pkg_deps() { - local f revdepname tmplf - - [ -z "$1" ] && return 1 + local f tmplf revdepname for f in $(find ${XBPS_SRCPKGDIR} -type f -name \*template); do if ! egrep -q "^Add_dependency[[:blank:]]+(run|full|build)[[:blank:]]+${1}([[:space:]]+\".*\")*$" $f; then @@ -42,3 +40,34 @@ show_pkg_revdeps() echo $revdepname done } + +_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 + done +} + +show_pkg_revdeps() +{ + local SHLIBS_MAP="$XBPS_COMMONVARSDIR/mapping_shlib_binpkg.txt" + + [ -z "$1" ] && return 1 + + shlibs=$(grep "$1" $SHLIBS_MAP) + if [ -n "$shlibs" ]; then + # pkg provides shlibs + _show_shlib_pkg_deps "$shlibs" + else + # pkg does not provide shlibs + _show_hard_pkg_deps "$1" + fi +}