#!/bin/sh
. /etc/blackPanther-default-apps.conf
#*********************************************************************************************************
#*   __     __               __     ______                __   __                      _______ _______   *
#*  |  |--.|  |.---.-..----.|  |--.|   __ \.---.-..-----.|  |_|  |--..-----..----.    |       |     __|  *
#*  |  _  ||  ||  _  ||  __||    < |    __/|  _  ||     ||   _|     ||  -__||   _|    |   -   |__     |  *
#*  |_____||__||___._||____||__|__||___|   |___._||__|__||____|__|__||_____||__|      |_______|_______|  *
#* http://www.blackpantheros.eu | http://www.blackpanther.hu - kbarcza[]blackpanther.hu * Charles Barcza *
#*************************************************************************************(c)2002-2011********
export PATH=$PATH:/usr/sbin:/sbin

case $LANG in 
	hu*) 
	notroot=$notroot_hu
	rpmimputerr=$rpmimputerr_hu
	header=$header_hu
	chkdbstatus=$chkdbstatus_hu
	chkdbagain=$chkdbagain_hu
	chknetstatus=$chknetstatus_hu
	accessyes=$accessyes_hu
	databasetimeout=$databasetimeout_hu
	dbwaito=$dbwaito_hu
	;;
	*) 
	notroot=$notroot_en
	rpmimputerr=$rpmimputerr_en
	enginerror=$enginerror_en
	header=$header_en
	chkdbstatus=$chkdbstatus_en
	chkdbagain=$chkdbagain_en
	chknetstatus=$chknetstatus_en
	accessyes=$accessyes_en
	databasetimeout=$databasetimeout_en
	dbwaito=$dbwaito_en	
	;;
esac

echo -e " 
${MAG} $header ${DEF}
--------------------------------------------------------------------------------------------
"

local() {
echo -en "${YEL}"
PACK=`rpmquery -i "$*"`
ret=$?
#echo RET$ret
if [ "$ret" = "1" ];then
    remot $*
 else
 echo -e "$PACK" | sed "s|^| * |g"

fi
}

remot() {
    echo -en "${GRN}"
    REMPACK=`urpmq -i "$*"`
    ret=$?
    if [ "$ret" = "1" ];then
	echo -en "${RED}"
	#echo "$REMPACK" | sed 's|^| + |g'
	#echo ""
    else
	echo "$REMPACK" | sed 's|^| + |g'
    fi
}

local $*

echo -e "${DEF}"
