diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index 72291949b5..d7ee91025d 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -188,6 +188,33 @@ check_rundep_dup() done } +dependency_version() +{ + local type="$1" pkgn="$2" + + if [ -f $XBPS_SRCPKGDIR/${pkgn}/${pkgn}.depends ]; then + . $XBPS_SRCPKGDIR/${pkgn}/${pkgn}.depends + elif [ -f $XBPS_SRCPKGDIR/${pkgn}/depends ]; then + . $XBPS_SRCPKGDIR/${pkgn}/depends + fi + + if [ "$type" = "build" ]; then + if [ -z "$api_depends" ]; then + echo "${pkgn}>=0" + else + echo "${pkgn}${api_depends}" + fi + elif [ "$type" = "run" ]; then + if [ -z "$abi_depends" ]; then + echo "${pkgn}>=0" + else + echo "${pkgn}${abi_depends}" + fi + fi + + unset abi_depends api_depends +} + Add_dependency() { local type="$1" pkgn="$2" ver="$3"