From 1ac31da6db392f743b5f75e31ac91e12fcb27b26 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sun, 22 Feb 2009 11:07:15 +0100 Subject: run-postinsts: add from poky --- packages/meta/run-postinsts/run-postinsts.awk | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/meta/run-postinsts/run-postinsts.awk (limited to 'packages/meta/run-postinsts/run-postinsts.awk') diff --git a/packages/meta/run-postinsts/run-postinsts.awk b/packages/meta/run-postinsts/run-postinsts.awk new file mode 100644 index 0000000000..09a1400cf4 --- /dev/null +++ b/packages/meta/run-postinsts/run-postinsts.awk @@ -0,0 +1,30 @@ +# +# Copyright 2007 Openedhand Ltd. +# +# Author: Richard Purdie +# +# Rather hacky proof of concept +# + +BEGIN { + rc=system("test -d /usr/dpkg/info/") + if (rc==0) + pkgdir="/var/dpkg/info" + else + pkgdir="/usr/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 +} -- cgit v1.2.3