From: Erich Eckner <git@eckner.net> When makepkg fails to install makedepends=() or checkdepends=(), it should still remove installed depends=() packages iff RMDEPS is set. To correctly do this, it needs to remember the installed packages after successfully installing depends=(). Signed-off-by: Erich Eckner <git@eckner.net> --- scripts/makepkg.sh.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index aa03e9d9..a6c94e97 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1366,6 +1366,10 @@ else msg "$(gettext "Checking runtime dependencies...")" resolve_deps ${depends[@]} || deperr=1 + if (( RMDEPS )); then + current_pkglist=($(run_pacman -Qq)) # required by remove_deps + fi + if (( RMDEPS && INSTALL )); then original_pkglist=($(run_pacman -Qq)) # required by remove_dep fi -- 2.22.0