Browse Source

net/wget: Remove use broken use of symlinks to /usr/bin/wget

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>
lilik-openwrt-22.03
Daniel Dickinson 8 years ago
parent
commit
1b2e2dcbff
1 changed files with 3 additions and 37 deletions
  1. +3
    -37
      net/wget/Makefile

+ 3
- 37
net/wget/Makefile View 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))


Loading…
Cancel
Save