diff --git a/xbps-src/shutils/pkgtarget_funcs.sh.in b/xbps-src/shutils/pkgtarget_funcs.sh.in index edcab1fb12..6a6714b118 100644 --- a/xbps-src/shutils/pkgtarget_funcs.sh.in +++ b/xbps-src/shutils/pkgtarget_funcs.sh.in @@ -166,6 +166,16 @@ install_pkg() if [ -d "$wrksrc" -a "$dontrm_builddir" = "no" ]; then remove_tmpl_wrksrc $wrksrc fi + + # + # If XBPS_PREFER_BINPKG_DEPS is set, we should remove those + # package dependencies installed by the target package, do it. + # + if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then + msg_normal "Removing binary package dependencies...\n" + ${XBPS_BIN_CMD} -Rpyf autoremove + fi + return $? } # diff --git a/xbps-src/shutils/stow_funcs.sh b/xbps-src/shutils/stow_funcs.sh index ddf7fafacf..5218a8f913 100644 --- a/xbps-src/shutils/stow_funcs.sh +++ b/xbps-src/shutils/stow_funcs.sh @@ -182,7 +182,10 @@ unstow_pkg_real() # If it's a metapkg, do nothing. : elif [ ! -f ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then - msg_error "$pkgname is incomplete, missing flist.\n" + # If flist not found, perhaps the pkg has been installed via + # xbps-bin, so try to remove it. + ${XBPS_BIN_CMD} -pyf remove ${pkgname} || \ + msg_error "${pkgname}: failed to remove!\n" elif [ ! -w ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then msg_error "$pkgname cannot be removed (permission denied).\n" elif [ -s ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then