diff mbox

[OpenWrt-Devel,4/5] package/network/utils/iproute: Allow smooth install/uninstall alongside busybox

Message ID 1453398885-102144-5-git-send-email-openwrt@daniel.thecshore.com
State Changes Requested
Headers show

Commit Message

Daniel Dickinson Jan. 21, 2016, 5:54 p.m. UTC
From: Daniel Dickinson <openwrt@daniel.thecshore.com>

Rather than have packages that behave badly
when used alongside busybox and/or which fails to
cleanly uninstall, make any package for which there
is a busybox applet work cleanly with busybox (taking
over from busybox when installed, and restoring
busybox when removed as well as behaving properly if the
corresponding busybox applet does not exist in busybox
(that is no extraneous symlink).

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
---
 package/network/utils/iproute2/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index af56577..a91c926 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -9,7 +9,7 @@  include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
 PKG_VERSION:=4.3.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
@@ -37,8 +37,12 @@  $(call Package/iproute2/Default,tiny,Minimal)
   CONFLICTS:=ip-full
 endef
 
+$(eval $(call Package/BusyBoxReplacement/Default,ip,/sbin,/usr/bin,../bin,ip))
+
 Package/ip-full=$(call Package/iproute2/Default,full,Full)
 
+$(eval $(call Package/BusyBoxReplacement/Default,ip-full,/sbin,/usr/sbin,../bin,ip))
+
 define Package/tc
 $(call Package/iproute2/Default)
   TITLE:=Traffic control utility
@@ -96,7 +100,7 @@  define Build/InstallDev
 	$(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
 endef
 
-define Package/ip/install
+define Package/ip-tiny/install
 	$(INSTALL_DIR) $(1)/usr/bin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/
 endef