#!/bin/ksh -p
# Copyright 02/19/01 Sun Microsystems, Inc. All Rights Reserved.
# @(#)utspatches.ksh 1.1     01/02/19 SMI

PROGRAM_ID=$(/bin/basename $0)
CATEGORY=sunray

################################################################
#
# MAIN
#
################################################################

set -u
umask 022

/bin/showrev -p > /tmp/${PROGRAM_ID}.$$.p1
/bin/touch /tmp/${PROGRAM_ID}.$$.p2
/bin/pkginfo -c ${CATEGORY} 2> /dev/null | /usr/bin/awk '{ print $2 }' | {
    while read PKG; do
	/bin/grep $PKG /tmp/${PROGRAM_ID}.$$.p1 >> /tmp/${PROGRAM_ID}.$$.p2
    done
}
/bin/sort /tmp/${PROGRAM_ID}.$$.p2 | /bin/uniq | /usr/bin/awk '{ print $2 }'

/bin/rm /tmp/${PROGRAM_ID}.$$.p1
/bin/rm /tmp/${PROGRAM_ID}.$$.p2
