summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2016-12-09 16:04:49 -0800
committerJo-Philipp Wich <jo@mein.io>2017-02-01 16:07:30 +0100
commit4d561b3a30c2bba4d525df2c13c4a938cef92b3e (patch)
tree6158a893a4100ae312e7961480b565989f597a7c
parentf8d8b60f1b410af299f39640031c16b2bf2fa2da (diff)
downloadmtk-20170518-4d561b3a30c2bba4d525df2c13c4a938cef92b3e.zip
mtk-20170518-4d561b3a30c2bba4d525df2c13c4a938cef92b3e.tar.gz
mtk-20170518-4d561b3a30c2bba4d525df2c13c4a938cef92b3e.tar.bz2
package-ipkg: Do not fail build without base-files
If the base-files package is not selected, we will fail executing the very first postinst script: make[3]: Leaving directory `/local/users/fainelli/openwrt/trunk' cp -fpR /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root-orion /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root.orig-orion ./usr/lib/opkg/info/busybox.postinst: line 3: /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root-orion/lib/functions.sh: No such file or directory ./usr/lib/opkg/info/busybox.postinst: line 4: default_postinst: command not found postinst script ./usr/lib/opkg/info/busybox.postinst has failed with exit code 127 make[2]: *** [package/install] Error 1 Check for the existence of lib/functions.sh, and if it does not exist, just bail out gracefully. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
-rw-r--r--include/package-ipkg.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index e168eb3..d9b6f77 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -209,11 +209,13 @@ $(_endef)
( \
echo "#!/bin/sh"; \
echo "[ \"\$$$${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; \
+ echo "[ -x "\$$$${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 ". \$$$${IPKG_INSTROOT}/lib/functions.sh"; \
echo "default_prerm \$$$$0 \$$$$@"; \
) > prerm; \