[build]: fix dpkg uninstall bug

fix a bug when there are multiple debian packages to be uninstalled

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
Guohan Lu 2021-01-01 01:00:47 -08:00 committed by lguohan
parent 66fffedc8a
commit 30a51c1ff7

View File

@ -145,11 +145,11 @@ expand = $(foreach d,$(1),$(call expand,$($(d)_$(2)),$(2))) $(1)
## Uninstall debs ## Uninstall debs
############################################################################### ###############################################################################
define UNINSTALL_DEBS define UNINSTALL_DEBS
$(info $(1)) if [ -n "$(1)" ]; then \
$(foreach deb,$(1), \ while true; do \
{ while true; do \ if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then \
if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then \ { sudo DEBIAN_FRONTEND=noninteractive dpkg -P $(foreach deb,$(1),$(firstword $(subst _, ,$(basename $(deb))))) $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && exit 1 ; } \
{ sudo DEBIAN_FRONTEND=noninteractive dpkg -P $(firstword $(subst _, ,$(basename $(deb)))) $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && exit 1 ; } \ fi; \
fi; \ done; \
done; } ) fi
endef endef