privoxy: fix preinst/postinst script indentation
authorAlois Klink <alois@aloisklink.com>
Wed, 23 Nov 2022 23:32:14 +0000 (23:32 +0000)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Thu, 8 Dec 2022 09:54:55 +0000 (10:54 +0100)
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 <m95d+git@psihoexpert.ro>
Signed-off-by: Alois Klink <alois@aloisklink.com>
net/privoxy/Makefile

index 9f859c4eb63670df4be18dca89d114e489f88ece..a7f5227b8b68e13bf2f8764ef4976d968e81f146 100644 (file)
@@ -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
-
-       # 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
+#!/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
 endef
 
 $(eval $(call BuildPackage,privoxy))