net/wget: Remove use broken use of symlinks to /usr/bin/wget 2729/head
authorDaniel Dickinson <lede@daniel.thecshore.com>
Mon, 23 May 2016 04:39:02 +0000 (00:39 -0400)
committerDaniel Dickinson <lede@daniel.thecshore.com>
Wed, 6 Jul 2016 09:26:02 +0000 (05:26 -0400)
postrm/postinst symlink mangling is frowned upon
by trunk devs, in addition to packages modifying
the files as other packages during
installation/removal (without a agreed upon mechanism
for coordinating such changes) is prohibited in
most distros.

Further in this case results in wget-ssl failing to conflict
with wget-nossl.  As mentioned in the github issue
regarding this (https://github.com/openwrt/packages/issues/2728)
it is also unnessary in current openwrt/lede.

This patch there makes the symlink from the specific
flavour of wget (e.g. wget-ssl) from /usr/bin/wget part
of /install so that they conflict with each other the
way they should, and do not modify the same files
without a delibarate --force-overwrite.

Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
net/wget/Makefile

index 65a440f3ebde32dde85a653bd6001de815e39e0c..2f26d9a04d78f48179064cf20ce6c865a20c82a2 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wget
 PKG_VERSION:=1.18
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
@@ -87,47 +87,13 @@ endif
 define Package/wget/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-ssl
+       ln -sf wget-ssl $(1)/usr/bin/wget
 endef
 
 define Package/wget-nossl/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-nossl
-endef
-
-define Package/wget/postinst
-#!/bin/sh
-if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
-  rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
-fi
-ln -sf ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget
-endef
-
-define Package/wget/postrm
-#!/bin/sh
-rm $${IPKG_INSTROOT}/usr/bin/wget
-[ -x $${IPKG_INSTROOT}/usr/bin/wget-nossl ] && ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget || {
-  ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
-  $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
-}
-exit 0
-endef
-
-define Package/wget-nossl/postinst
-#!/bin/sh
-if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
-  rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
-fi
-ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget
-endef
-
-define Package/wget-nossl/postrm
-#!/bin/sh
-rm $${IPKG_INSTROOT}/usr/bin/wget
-[ -x $${IPKG_INSTROOT}/usr/bin/wget-ssl ] && ln -s ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget || {
-  ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
-  $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
-}
-exit 0
+       ln -sf wget-nossl $(1)/usr/bin/wget
 endef
 
 $(eval $(call BuildPackage,wget))