packages: fix typo in OpenWrt name
[openwrt/staging/chunkeey.git] / package / base-files / files / lib / functions.sh
index b88d4d62175a785d5f0651ff127d2407ac09cb59..9d98fb0fbe4260e687d71ffaa04f08c2fc748918 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2006-2013 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 # Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
 # Copyright (C) 2010 Vertical Communications
 
@@ -173,7 +173,6 @@ default_prerm() {
 default_postinst() {
        local name rusers
        name=$(echo $(basename $1) | cut -d. -f1)
-       [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg )
        rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.control)
        [ -n "$rusers" ] && {
                local user group uid gid
@@ -193,7 +192,10 @@ default_postinst() {
                                }
 
                                gid=$id
-                               [ -n "$gid" ] && group_exists $name || group_add $name $gid
+                               [ -n "$gid" ] && {
+                                       group_exists $name || group_add $name $gid
+                               }
+
                                [ -z "$gid" ] && {
                                        group_add_next $name
                                        gid=$?
@@ -209,6 +211,10 @@ default_postinst() {
                        done
                done
        }
+
+       [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.postinst-pkg )
+       [ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null
+
        [ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${name}.list | grep "^/etc/init.d/"`; do
                [ -n "${IPKG_INSTROOT}" ] && $(which bash) ${IPKG_INSTROOT}/etc/rc.common ${IPKG_INSTROOT}$i enable; \
                [ -n "${IPKG_INSTROOT}" ] || {