diff options
author | Jonas Gorski <jogo@openwrt.org> | 2015-05-19 09:13:17 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2015-05-19 09:13:17 +0000 |
commit | c6e0a4d12324170960e244d6d8a2a9f5a26b3c3d (patch) | |
tree | 1a195c06b528628b3b005ab5f46ae242f80884c9 | |
parent | 376552be86aebeffe91746bdb7e47270e7e3fc49 (diff) | |
download | upstream-c6e0a4d12324170960e244d6d8a2a9f5a26b3c3d.tar.gz upstream-c6e0a4d12324170960e244d6d8a2a9f5a26b3c3d.tar.bz2 upstream-c6e0a4d12324170960e244d6d8a2a9f5a26b3c3d.zip |
base-files: fix default pre-/postrm for packages with a dot
Instead of stripping everything after the first dot, strip everything
after the last dot.
This fixes pre-/postrm actions for packages with a dot in their name,
like libusb-1.0.
Fixes #19668.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45702 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-x | package/base-files/files/lib/functions.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 72d954db3c..8d045fa642 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -165,7 +165,7 @@ insert_modules() { default_prerm() { local name - name=$(echo $(basename $1) | cut -d. -f1) + name=$(basename ${1%.*}) [ -f /usr/lib/opkg/info/${name}.prerm-pkg ] && . /usr/lib/opkg/info/${name}.prerm-pkg for i in `cat /usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do $i disable @@ -175,7 +175,7 @@ default_prerm() { default_postinst() { local pkgname rusers - pkgname=$(echo $(basename $1) | cut -d. -f1) + pkgname=$(basename ${1%.*}) rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control) [ -n "$rusers" ] && { local user group uid gid |