base-files: remove execute bit and shebang from functions.sh
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 25 Jan 2021 11:48:43 +0000 (12:48 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 29 Jan 2021 13:30:32 +0000 (14:30 +0100)
/lib/functions.sh was executable for no obvious reason and its
execute property was even checked in package-ipkg.mk just to
source it afterwards.

Remove the execute bit and shebang as this is clearly a library.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
include/package-ipkg.mk
package/base-files/files/lib/functions.sh [changed mode: 0755->0644]

index a92d69212147301124935d969115353a969ae346..32de3cc93ee896c19571e6cc8c42597393e1a67b 100644 (file)
@@ -232,13 +232,13 @@ $(_endef)
                ( \
                        echo "#!/bin/sh"; \
                        echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
-                       echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
+                       echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
                        echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
                        echo "default_postinst \$$$$0 \$$$$@"; \
                ) > postinst; \
                ( \
                        echo "#!/bin/sh"; \
-                       echo "[ -x "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
+                       echo "[ -s "\$$$${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; \
                        echo ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
                        echo "default_prerm \$$$$0 \$$$$@"; \
                ) > prerm; \
old mode 100755 (executable)
new mode 100644 (file)
index 272e230..2bad453
@@ -1,4 +1,3 @@
-#!/bin/sh
 # Copyright (C) 2006-2014 OpenWrt.org
 # Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
 # Copyright (C) 2010 Vertical Communications