#!/bin/sh
#
# aryzhov@spasu.net
# Remove some unneeded SUNWCreq packages after the install
#
[ -z "$SID" ] && SID=/tmp/install_config
[ X$SubrIsRead = XYes ] || . $SID/Scripts/Misc/!Includes/Subroutines
[ X$VarsAreSet = XYes ] || SetJVars
SetRootOpts ; [ X$ROOT != X/ ] && exec Chroot_Script $0 $*


PKG_LIST_DIR=$SI_CONFIG_DIR/Profiles/$SITE/Packages/pkginfo
LIST_MIN=$PKG_LIST_DIR/${MYNAME}.min
pkginfo | sort >/tmp/List_Full
sort $LIST_MIN >/tmp/List_Min || StartShell

MakeAdminFile

for i in `diff /tmp/List_Full /tmp/List_Min | awk '$1=="<" && NF>=3 {print $3}'`; do
  pkgrm -nM -a $PKGADMIN_FILE $i 2>&1 | grep -v mail | sed '/^ *$/d'
done

