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:
Richard Purdie 2008-05-20 12:37:49 +00:00
parent 8b60069706
commit b8d979bf08
3 changed files with 18 additions and 3 deletions

View File

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

View File

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

View File

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