diff --git a/xbps-src/shutils/metadata.sh b/xbps-src/shutils/metadata.sh index 71818978e0..b69dc4bf02 100644 --- a/xbps-src/shutils/metadata.sh +++ b/xbps-src/shutils/metadata.sh @@ -98,6 +98,33 @@ xbps_write_metadata_pkg_real() lver="${version}" fi + # + # If package provides virtual packages, create dynamically the + # required virtualpkg.d files. + # + if [ -n "$provides" -a -n "$replaces" ]; then + _tmpf=$(mktemp) || msg_error "$pkgver: failed to create tempfile.\n" + cat > ${_tmpf} <<_EOF + + + + + virtual-pkgver + $provides + target-pkgpattern + $replaces + + +_EOF + install -Dm644 ${_tmpf} \ + ${DESTDIR}/etc/xbps/virtualpkg.d/${pkgname}.plist + vmkdir etc/xbps/virtualpkg.d.wants && curcwd=$(pwd) && \ + cd ${DESTDIR}/etc/xbps/virtualpkg.d.wants && \ + ln -sf ../virtualpkg.d/${pkgname}.plist . && \ + cd ${curcwd} && rm -f ${_tmpf} || \ + msg_error "$pkgver: failed to create virtualpkg.d file in DESTDIR!\n" + fi + # # Find out if this package contains info files and compress # all them with gzip. diff --git a/xbps-src/shutils/stow_funcs.sh b/xbps-src/shutils/stow_funcs.sh index 769eb82228..2d79adfc2d 100644 --- a/xbps-src/shutils/stow_funcs.sh +++ b/xbps-src/shutils/stow_funcs.sh @@ -171,7 +171,7 @@ unstow_pkg_real() ver=$($XBPS_PKGDB_CMD version $pkgname) if [ -z "$ver" ]; then msg_warn "'${pkgname}' not installed in masterdir!\n" - return 0 + return 1 fi if [ "$build_style" = "meta-template" ]; then