[pacman-dev] [PATCH] makepkg: remove installed packages if installation of makedepends fails

arch at eckner.net arch at eckner.net
Tue Jun 25 11:39:51 UTC 2019


From: Erich Eckner <git at 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 at 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


More information about the pacman-dev mailing list