#!/bin/sh
#****************************************************************
# *	Copyright (C) 2003, Wistron Inc.  All Rights Reserved.
# *	File Name:		createrpminfo
# *	Author:			Jerry Zhou
# *	Create Time: 	2003-11-12 16:49:27
# *	Last Update: 	2003-11-12 16:49:27
#****************************************************************
rpmlist=`rpm -qa`
sm_path=/usr/local/share/asmagent/wsma
tmpfile=$sm_path/pkginfotmp
pkgfile=$sm_path/pkginfo
rm -f $tmpfile
for i in $rpmlist
do
	echo "beginbegin">> $tmpfile
	echo "Name=="$i >> $tmpfile
	/bin/rpm --qf="ProductName==%{Name}\nProductVendor==%{vendor}\nProductVersion==%{version}\n" --query $i >> $tmpfile
	echo "endend" >> $tmpfile
done
rm -f $pkgfile
mv -f $tmpfile $pkgfile