summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-08-17 06:17:23 +0000
committerJohn Crispin <john@openwrt.org>2015-08-17 06:17:23 +0000
commite83643d31c2364166f411e7a1bb8c183489705c0 (patch)
tree9989e29ec17c1174ebbeaedbc86e33f1ab3b37ac
parente5488123e6336848c7c9dbbcbdfe3b339e048af6 (diff)
downloadmaster-31e0f0ae-e83643d31c2364166f411e7a1bb8c183489705c0.tar.gz
master-31e0f0ae-e83643d31c2364166f411e7a1bb8c183489705c0.tar.bz2
master-31e0f0ae-e83643d31c2364166f411e7a1bb8c183489705c0.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> SVN-Revision: 46653
-rwxr-xr-xpackage/base-files/files/lib/functions.sh10
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() {