Message ID | 20210125114843.2210-2-freifunk@adrianschmutzler.de |
---|---|
State | Accepted |
Delegated to: | Adrian Schmutzler |
Headers | show |
Series | [1/2] treewide: drop shebang from non-executable lib files | expand |
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com> > On Jan 25, 2021, at 4:48 AM, Adrian Schmutzler <freifunk@adrianschmutzler.de> wrote: > > /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> > --- > include/package-ipkg.mk | 4 ++-- > package/base-files/files/lib/functions.sh | 1 - > 2 files changed, 2 insertions(+), 3 deletions(-) > mode change 100755 => 100644 package/base-files/files/lib/functions.sh > > diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk > index a92d692121..32de3cc93e 100644 > --- a/include/package-ipkg.mk > +++ b/include/package-ipkg.mk > @@ -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; \ > diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh > old mode 100755 > new mode 100644 > index 272e230db2..2bad45324f > --- a/package/base-files/files/lib/functions.sh > +++ b/package/base-files/files/lib/functions.sh > @@ -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 > -- > 2.20.1 > > > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index a92d692121..32de3cc93e 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -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; \ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh old mode 100755 new mode 100644 index 272e230db2..2bad45324f --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -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
/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> --- include/package-ipkg.mk | 4 ++-- package/base-files/files/lib/functions.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) mode change 100755 => 100644 package/base-files/files/lib/functions.sh