run-postinsts: Handle dpkg based images too
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4507 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
parent
8b60069706
commit
b8d979bf08
|
@ -5,7 +5,17 @@
|
|||
# Author: Richard Purdie <rpurdie@openedhand.com>
|
||||
#
|
||||
|
||||
PKGSYSTEM=/usr/lib/opkg
|
||||
PKGSYSTEM=/usr/dpkg
|
||||
|
||||
if [ ! -e $PKGSYSTEM/status ]; then
|
||||
if [ -e /usr/lib/opkg/status ]; then
|
||||
PKGSYSTEM=/usr/lib/opkg
|
||||
else
|
||||
echo "No package system found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
STAMP=$PKGSYSTEM/postinsts-done
|
||||
STATFILE=$PKGSYSTEM/status
|
||||
STATFILE2=$PKGSYSTEM/status2
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
#
|
||||
|
||||
BEGIN {
|
||||
rc=system("test -d /usr/dpkg/info/")
|
||||
if (rc==0)
|
||||
pkgdir="/usr/dpkg/info"
|
||||
else
|
||||
pkgdir="/usr/lib/opkg/info"
|
||||
package=""
|
||||
}
|
||||
/Package:.*/ {
|
||||
|
@ -14,7 +19,7 @@ BEGIN {
|
|||
}
|
||||
/Status:.*unpacked.*/ {
|
||||
print "Configuring: " package > "/dev/stderr"
|
||||
ret = system("/usr/lib/opkg/info/" package ".postinst 1>&2")
|
||||
ret = system(pkgdir "/" package ".postinst 1>&2")
|
||||
if (ret == 0)
|
||||
$0 = gensub("unpacked", "installed", 1)
|
||||
else
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
DESCRIPTION = "Run postinstall scripts on device using awk"
|
||||
SECTION = "devel"
|
||||
PR = "r1"
|
||||
PR = "r4"
|
||||
|
||||
SRC_URI = "file://run-postinsts file://run-postinsts.awk"
|
||||
|
||||
|
|
Loading…
Reference in New Issue