summaryrefslogtreecommitdiffstats
path: root/meta/packages/meta/run-postinsts/run-postinsts.awk
blob: 1532577b6e4b2ff0b87cd22ad17c78732221e803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# Copyright 2007 Openedhand Ltd.
#
# Author: Richard Purdie <rpurdie@openedhand.com>
#
# Rather hacky proof of concept
#

BEGIN {
  package=""
}
/Package:.*/ {
  package = substr($0, 10)
}
/Status:.*unpacked.*/ {
  print "Configuring: " package > "/dev/stderr"
  ret = system("/usr/lib/ipkg/info/" package ".postinst 1>&2")
  if (ret == 0)
    $0 = gensub("unpacked", "installed", 1)
  else
    print "Postinstall failed for " package > "/dev/stderr"
}
{
  print $0
}