xbps-src: new func dependency_version() to return pkg+a[pb]i_depends.

This commit is contained in:
Juan RP 2011-11-11 15:58:40 +01:00
parent a962644f9a
commit 9bda824de0

View file

@ -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"