summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-05-20 12:37:49 +0000
committerRichard Purdie <richard@openedhand.com>2008-05-20 12:37:49 +0000
commitb8d979bf08cf23ddc722ccb241341d9db5be18ba (patch)
treec53e7bfea0e3eae70a375fed72ff67184e3232af
parent8b600697063be023882333d866e20ba8fac8dc81 (diff)
downloadopenembedded-core-b8d979bf08cf23ddc722ccb241341d9db5be18ba.tar.gz
openembedded-core-b8d979bf08cf23ddc722ccb241341d9db5be18ba.tar.bz2
openembedded-core-b8d979bf08cf23ddc722ccb241341d9db5be18ba.tar.xz
openembedded-core-b8d979bf08cf23ddc722ccb241341d9db5be18ba.zip
run-postinsts: Handle dpkg based images too
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4507 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rwxr-xr-xmeta/packages/meta/run-postinsts/run-postinsts12
-rw-r--r--meta/packages/meta/run-postinsts/run-postinsts.awk7
-rw-r--r--meta/packages/meta/run-postinsts_1.0.bb2
3 files changed, 18 insertions, 3 deletions
diff --git a/meta/packages/meta/run-postinsts/run-postinsts b/meta/packages/meta/run-postinsts/run-postinsts
index cb24a623f..46b3327f4 100755
--- a/meta/packages/meta/run-postinsts/run-postinsts
+++ b/meta/packages/meta/run-postinsts/run-postinsts
@@ -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
diff --git a/meta/packages/meta/run-postinsts/run-postinsts.awk b/meta/packages/meta/run-postinsts/run-postinsts.awk
index 46ee8df9a..bdea8c95a 100644
--- a/meta/packages/meta/run-postinsts/run-postinsts.awk
+++ b/meta/packages/meta/run-postinsts/run-postinsts.awk
@@ -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
diff --git a/meta/packages/meta/run-postinsts_1.0.bb b/meta/packages/meta/run-postinsts_1.0.bb
index bf132f51f..ec3412738 100644
--- a/meta/packages/meta/run-postinsts_1.0.bb
+++ b/meta/packages/meta/run-postinsts_1.0.bb
@@ -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"