Intergrated test scripts with automake
[gnucomo.git] / scripts / package-solaris
1 #!/bin/sh
2 #
3 # Gnucomo package parameter report.
4 #
5 # Create a list of packages and patches on a Solaris system
6 # that can be read by the Gnucomo input program, gcm_input.
7
8
9
10 HOST=`hostname`
11 TIME=`date`
12 FILTER=/usr/local/bin/pkg-solaris.awk
13
14 echo "<?xml version='1.0'?>"
15 echo "<gcmt:message xmlns:gcmt='http://gnucomo.org/transport/'>"
16 echo "  <gcmt:header>"
17 echo "      <gcmt:messagetype>package list</gcmt:messagetype>"
18 echo "      <gcmt:hostname>$HOST</gcmt:hostname>"
19 echo "      <gcmt:time>$TIME</gcmt:time>"
20 echo "   </gcmt:header>"
21 echo "   <gcmt:data>"
22
23 echo "   <gcmt:parameters gcmt:class='package'>"
24
25 pkginfo -l|awk -f $FILTER |sed -e 's/&/&amp;/'
26
27 showrev -p | cut -f2 "-d " |sort| tr '-' ' ' > /tmp/patchlist.$$
28 read PREV_PATCH PREV_VERSION < /tmp/patchlist.$$
29
30 while read PATCH VERSION
31 do
32    if [ $PREV_PATCH = $PATCH ]
33    then
34       PREV_VERSION=$VERSION
35    else
36       echo "<gcmt:parameter name='$PREV_PATCH'>"
37       echo "   <gcmt:description>Solaris patch $PREV_PATCH</gcmt:description>"
38       echo "   <gcmt:property name='version'>$PREV_VERSION</gcmt:property>"
39       echo "</gcmt:parameter>"
40    fi
41    PREV_PATCH=$PATCH
42    PREV_VERSION=$VERSION
43 done < /tmp/patchlist.$$
44
45 tail -1 /tmp/patchlist.$$ >/tmp/patchtail.$$
46 read PATCH VERSION </tmp/patchtail.$$
47 echo "<gcmt:parameter name='$PATCH'>"
48 echo "   <gcmt:description>Solaris patch $PATCH</gcmt:description>"
49 echo "   <gcmt:property name='version'>$VERSION</gcmt:property>"
50 echo "</gcmt:parameter>"
51
52 echo "    </gcmt:parameters>"
53 echo "   </gcmt:data>"
54 echo "</gcmt:message>"
55
56 rm /tmp/patchlist.$$
57 rm /tmp/patchtail.$$
58