diff --git a/xbps-src/shutils/builddep_funcs.sh b/xbps-src/shutils/builddep_funcs.sh index d01e3ecb66..f7f41d15ae 100644 --- a/xbps-src/shutils/builddep_funcs.sh +++ b/xbps-src/shutils/builddep_funcs.sh @@ -92,7 +92,7 @@ autoremove_pkg_dependencies() if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then msg_normal "$pkgver: removing automatically installed dependencies ...\n" # Autoremove installed binary packages. - ${cmd} -y reconfigure all && ${cmd} -Rpyf autoremove 2>&1 >/dev/null + ${cmd} -y reconfigure all && ${cmd} -Rpyf autoremove if [ $? -ne 0 ]; then msg_red "$pkgver: failed to remove automatic dependencies!\n" exit 1 diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 822814563c..6075c8b641 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -85,6 +85,9 @@ Targets: clean [pkgname] Remove build directory. + clean-autodeps + Removes all package dependencies installed automatically. + configure [pkgname] Configure a package (fetch + extract + configure). @@ -431,6 +434,14 @@ clean) setup_tmpl ${_pkgname} remove_tmpl_wrksrc $wrksrc ;; +clean-autodeps) + if [ -z "$IN_CHROOT" ]; then + xbps_chroot_handler clean-autodeps dummy + else + pkgver=xbps-src + autoremove_pkg_dependencies + fi + ;; extract|fetch) if [ -z "${_pkgname}" ]; then [ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"