generic-poky/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk
Kenneth Solbjerg dd28dee711 run-postinsts: Does not run any scripts on debian rootfs
On my system (core-image-base, .deb package files), run-postinsts does
not run any scripts due to a failed test in run-postinsts.awk.
As dpkg is not actually installed on target, opkg is identified as the
pkgdir and that is not right...

(From OE-Core rev: e782cefd53cf3d3cc8ad7484335a697f9dde5751)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-15 14:26:37 +01:00

31 lines
586 B
Awk

#
# Copyright 2007 Openedhand Ltd.
#
# Author: Richard Purdie <rpurdie@openedhand.com>
#
# Rather hacky proof of concept
#
BEGIN {
rc=system("test -d /var/lib/dpkg/info/")
if (rc==0)
pkgdir="/var/lib/dpkg/info"
else
pkgdir="/var/lib/opkg/info"
package=""
}
/Package:.*/ {
package = substr($0, 10)
}
/Status:.*unpacked.*/ {
print "Configuring: " package > "/dev/stderr"
ret = system(pkgdir "/" package ".postinst 1>&2")
if (ret == 0)
$0 = gensub("unpacked", "installed", 1)
else
print "Postinstall failed for " package > "/dev/stderr"
}
{
print $0
}