From 9bda824de05f3f736bbfe54a111451a691ff3d6d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 11 Nov 2011 15:58:40 +0100 Subject: [PATCH] xbps-src: new func dependency_version() to return pkg+a[pb]i_depends. --- xbps-src/shutils/tmpl_funcs.sh.in | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index 72291949b58..d7ee91025d4 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"