From 6703d7623097b591ea08c12e66351eed884e1005 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Wed, 23 Nov 2022 23:32:14 +0000 Subject: [PATCH] privoxy: fix preinst/postinst script indentation Fix the indentation of the preinst/postinst scripts for the privoxy package. Because these scripts didn't start with `#!/bin/sh` (they instead started with the TAB character), `/bin/sh` was not used to start them. On x86_64 and i386_pentium-mmx, this seems to be fine, but on arm_cortex-a15_neon-vfpv4 and aarch64_cortex-a53, running these scripts fails with a: ``` Installing privoxy (3.0.33-3) to root... Collected errors: * pkg_run_script: package "privoxy" preinst script returned status 1. * preinst_configure: Aborting installation of privoxy. * opkg_install_cmd: Cannot install package privoxy. ``` Reported-by: Marius Dinu Signed-off-by: Alois Klink --- net/privoxy/Makefile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/net/privoxy/Makefile b/net/privoxy/Makefile index 9f859c4eb6..a7f5227b8b 100644 --- a/net/privoxy/Makefile +++ b/net/privoxy/Makefile @@ -118,13 +118,13 @@ define Package/privoxy/conffiles endef define Package/privoxy/preinst - #!/bin/sh - [ -n "$${IPKG_INSTROOT}" ] && exit 0 # if run within buildroot exit +#!/bin/sh +[ -n "$${IPKG_INSTROOT}" ] && exit 0 # if run within buildroot exit - # stop service if PKG_UPGRADE - [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/privoxy stop >/dev/null 2>&1 - - exit 0 # suppress errors from stop command +# stop service if PKG_UPGRADE +[ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/privoxy stop >/dev/null 2>&1 + +exit 0 # suppress errors from stop command endef define Package/privoxy/install @@ -156,16 +156,16 @@ define Package/privoxy/install endef define Package/privoxy/postinst - #!/bin/sh - # if exists, update previous version entry missing protocol - (grep -E "privoxy.*8118$$" $${IPKG_INSTROOT}/etc/services) > /dev/null \ - && sed -i "s/privoxy.*8118/privoxy\t\t8118\/tcp/" $${IPKG_INSTROOT}/etc/services +#!/bin/sh +# if exists, update previous version entry missing protocol +(grep -E "privoxy.*8118$$" $${IPKG_INSTROOT}/etc/services) > /dev/null \ + && sed -i "s/privoxy.*8118/privoxy\t\t8118\/tcp/" $${IPKG_INSTROOT}/etc/services - # add missing tcp and udp entries - (grep -E "privoxy.*8118\/tcp" $${IPKG_INSTROOT}/etc/services) > /dev/null \ - || echo -e "privoxy\t\t8118/tcp" >> $${IPKG_INSTROOT}/etc/services - (grep -E "privoxy.*8118\/udp" $${IPKG_INSTROOT}/etc/services) > /dev/null \ - || echo -e "privoxy\t\t8118/udp" >> $${IPKG_INSTROOT}/etc/services +# add missing tcp and udp entries +(grep -E "privoxy.*8118\/tcp" $${IPKG_INSTROOT}/etc/services) > /dev/null \ + || echo -e "privoxy\t\t8118/tcp" >> $${IPKG_INSTROOT}/etc/services +(grep -E "privoxy.*8118\/udp" $${IPKG_INSTROOT}/etc/services) > /dev/null \ + || echo -e "privoxy\t\t8118/udp" >> $${IPKG_INSTROOT}/etc/services endef $(eval $(call BuildPackage,privoxy))