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 <m95d+git@psihoexpert.ro>
Signed-off-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
Alois Klink 2022-11-23 23:32:14 +00:00 committed by Josef Schlehofer
parent d20f2e324d
commit 6703d76230
1 changed files with 15 additions and 15 deletions

View 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
#!/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))