From 9d50c2fb05de8cc3c9e1efc76c3c64e8b48a28be Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 17 Aug 2014 19:21:25 +0200 Subject: [PATCH] xbps-src: use "virtual?" keyword to declare virtual runtime dependencies. The syntax "pkg?vpkg" can be used in hostmakedepends, makedepends and depends; but the "virtual" keyword can be declared specifically for runtime dependencies (depends). --- common/hooks/post-install/04-generate-runtime-deps.sh | 1 + common/xbps-src/shutils/build_dependencies.sh | 5 +++++ common/xbps-src/shutils/common.sh | 9 +++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common/hooks/post-install/04-generate-runtime-deps.sh b/common/hooks/post-install/04-generate-runtime-deps.sh index b32703dcc3..043b4b42fd 100644 --- a/common/hooks/post-install/04-generate-runtime-deps.sh +++ b/common/hooks/post-install/04-generate-runtime-deps.sh @@ -156,6 +156,7 @@ hook() { if [ -n "$run_depends" ]; then echo "$run_depends" > ${PKGDESTDIR}/rdeps + sed 's,virtual?,,g' -i ${PKGDESTDIR}/rdeps fi if [ -n "${sorequires}" ]; then echo "${sorequires}" > ${PKGDESTDIR}/shlib-requires diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh index 7c87612a3e..e0516b0e88 100644 --- a/common/xbps-src/shutils/build_dependencies.sh +++ b/common/xbps-src/shutils/build_dependencies.sh @@ -180,6 +180,11 @@ install_pkg_deps() { for i in ${build_depends} "RDEPS" ${run_depends}; do [ "$i" = "RDEPS" ] && rundep="runtime" && continue _realpkg="${i%\?*}" + if [ "${_realpkg}" = "virtual" ]; then + # ignore virtual dependencies + echo " [${rundep:-target}] ${i#*\?}: virtual dependency." + continue + fi pkgn=$($XBPS_UHELPER_CMD getpkgdepname "${_realpkg}") if [ -z "$pkgn" ]; then pkgn=$($XBPS_UHELPER_CMD getpkgname "${_realpkg}") diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index 98db18a435..deaadefb03 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -391,7 +391,7 @@ setup_pkg() { } setup_pkg_depends() { - local pkg="$1" j _pkgdepname _pkgdep _depname + local pkg="$1" j _pkgdepname _pkgdep _rpkgname _depname if [ -n "$pkg" ]; then # subpkg @@ -401,6 +401,7 @@ setup_pkg_depends() { fi for j in ${depends}; do + _rpkgname="${j%\?*}" _depname="${j#*\?}" _pkgdepname="$($XBPS_UHELPER_CMD getpkgdepname ${_depname} 2>/dev/null)" if [ -z "${_pkgdepname}" ]; then @@ -412,7 +413,11 @@ setup_pkg_depends() { else _pkgdep="${_depname}" fi - run_depends+=" ${_pkgdep}" + if [ "${_rpkgname}" = "virtual" ]; then + run_depends+=" virtual?${_pkgdep}" + else + run_depends+=" ${_pkgdep}" + fi done for j in ${hostmakedepends}; do _depname="${j%\?*}"