Skip to content

Commit

Permalink
[build]: fix dpkg uninstall bug
Browse files Browse the repository at this point in the history
fix a bug when there are multiple debian packages to be uninstalled

Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan committed Jan 20, 2021
1 parent fcc8679 commit ccec723
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rules/functions
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ expand = $(foreach d,$(1),$(call expand,$($(d)_$(2)),$(2))) $(1)
## Uninstall debs
###############################################################################
define UNINSTALL_DEBS
$(info $(1))
$(foreach deb,$(1), \
{ while true; do \
if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then \
{ 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; \
done; } )
if [ -n "$(1)" ]; then \
while true; do \
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 ; } \
fi; \
done; \
fi
endef

###############################################################################
Expand Down

0 comments on commit ccec723

Please sign in to comment.