Changeset 45702


Ignore:
Timestamp:
2015-05-19T11:13:17+02:00 (3 years ago)
Author:
jogo
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/lib/functions.sh

    r45367 r45702  
    166166default_prerm() { 
    167167        local name 
    168         name=$(echo $(basename $1) | cut -d. -f1) 
     168        name=$(basename ${1%.*}) 
    169169        [ -f /usr/lib/opkg/info/${name}.prerm-pkg ] && . /usr/lib/opkg/info/${name}.prerm-pkg 
    170170        for i in `cat /usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do 
     
    176176default_postinst() { 
    177177        local pkgname rusers 
    178         pkgname=$(echo $(basename $1) | cut -d. -f1) 
     178        pkgname=$(basename ${1%.*}) 
    179179        rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control) 
    180180        [ -n "$rusers" ] && { 
Note: See TracChangeset for help on using the changeset viewer.