diff options
author | John Crispin <blogic@openwrt.org> | 2016-03-01 08:14:40 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2016-03-01 08:14:40 +0000 |
commit | f4598c54e5b2ec4cc661104e32cd8feee3f83b6a (patch) | |
tree | 9c6a19fa522d5d0098cad607321a75205bb7d9b2 /package/base-files | |
parent | a45758c50709961bb28d402aaf0de69bc8d23388 (diff) | |
download | upstream-f4598c54e5b2ec4cc661104e32cd8feee3f83b6a.tar.gz upstream-f4598c54e5b2ec4cc661104e32cd8feee3f83b6a.tar.bz2 upstream-f4598c54e5b2ec4cc661104e32cd8feee3f83b6a.zip |
base-files: default_postinst: propagate the real postinst return code
Using the postinst script for sanity checks and expecting opkg to fail
if the postinst didn't return 0 was possible in Barrier Breaker, propagate
the real postinst return code through default_postinst to restore this
behaviour.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Backport of r46653
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@48838 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-rwxr-xr-x | package/base-files/files/lib/functions.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 8d045fa642..2f78d67025 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -174,7 +174,8 @@ default_prerm() { } default_postinst() { - local pkgname rusers + local pkgname rusers ret + ret=0 pkgname=$(basename ${1%.*}) rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control) [ -n "$rusers" ] && { @@ -215,7 +216,10 @@ default_postinst() { done } - [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ) + if [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ]; then + ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ) + ret=$? + fi [ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null [ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.list | grep "^/etc/init.d/"`; do @@ -225,7 +229,7 @@ default_postinst() { $i start } done - return 0 + return $ret } include() { |