aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorMarko Ratkaj <marko.ratkaj@sartura.hr>2017-11-07 06:48:09 +0100
committerMathias Kresin <dev@kresin.me>2017-11-08 23:18:22 +0100
commit73c745f64f17a0326c53e614aa0dd125b47053ec (patch)
treea74b77395a48fca61d5037ae2ffa9fb41a8e8aae /package/base-files/files
parent74f891752b617a9f17f675f341160458c055b301 (diff)
downloadupstream-73c745f64f17a0326c53e614aa0dd125b47053ec.tar.gz
upstream-73c745f64f17a0326c53e614aa0dd125b47053ec.tar.bz2
upstream-73c745f64f17a0326c53e614aa0dd125b47053ec.zip
functions.sh: fix default_postinst function
When we run "opkg install" on a package that installs an uci-defaults script, functions.sh will fail to evaluate that script in its default_postinst function. This happens because there is no "./" present and it searches for the file in paths specified by the PATH variable. This would work on bash, but it will not work on ash and some other shells like sh, zsh. This applys to the ". filename" directive used in this case. This patch will make the path relative to the /etc/uci-defaults directory. Fixes: FS#1021 Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index c3988b900f..4879a3708a 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -244,7 +244,7 @@ default_postinst() {
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do (
cd /etc/uci-defaults
- [ -f "$i" ] && . "$i" && rm -f "$i"
+ [ -f "$i" ] && . ./"$i" && rm -f "$i"
) done
uci commit
fi