summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/run-postinsts/run-postinsts
blob: 584a92ebfdf0c00b73230a4dd40de74dcf06f913 (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
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# Copyright 2007 Openedhand Ltd.
#
# Author: Richard Purdie <rpurdie@openedhand.com>
#

PKGSYSTEM=/var/lib/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

if [ -e $STAMP ]; then
  exit 0
fi

awk -f /usr/share/run-postinsts/run-postinsts.awk $STATFILE > $STATFILE2
if [ $? = 0 ]; then
  mv $STATFILE2 $STATFILE
  touch $STAMP
  exit 0
else
  rm -f $STATFILE2
  rm -f $STAMP
  exit 1
fi
OpenPOWER on IntegriCloud