support a clean uninstall of blue-merle

Before this change, uninstalling the package would complain about
/tmp/sim_change_start not existing:

root@GL-E750:/tmp# opkg remove blue-merle
Removing package blue-merle from root...
The /tmp/ directory exists.
The /etc/ directory exists.
killall: gltertf: no process killed
No file found within /tmp/tertf. No shredding to be done there.
No file found within /etc/tertf. No shredding to be done there.
Looks like /tmp/ is clean!
Looks like /etc/ is clean!
rm: can't remove '/tmp/sim_change_start': No such file or directory
rm: can't remove '/tmp/sim_change_switch': No such file or directory
No packages removed.
Collected errors:
 * pkg_run_script: package "blue-merle" postrm script returned status 1.
root@GL-E750:/tmp#

So we use -f to not raise an error if the file does not exist.
This commit is contained in:
Tobias Mueller 2023-08-28 09:55:41 +02:00
parent 0f2b358b31
commit 7aaf65e8bd

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=blue-merle
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.2
PKG_RELEASE:=$(AUTORELEASE)
PKG_MAINTAINER:=Matthias <matthias@srlabs.de>
@ -144,8 +144,8 @@ define Package/blue-merle/postrm
mv /usr/bin/switchaction.orig /usr/bin/switchaction
mv /usr/bin/switch_queue.orig /usr/bin/switch_queue
rm /tmp/sim_change_start
rm /tmp/sim_change_switch
rm -f /tmp/sim_change_start
rm -f /tmp/sim_change_switch
endef
$(eval $(call BuildPackage,$(PKG_NAME)))