#!/bin/sh
#
#refresh: version 1.0
#
#usage:
#
#./refreshdb

. $INSTDIR/core-functions

#acquire the complete list of installed tgz's
echo -e "\n  --> getting list of installed tgz's"

#count tgz's
TGZNUM=$(ls $PKGDIR | wc -l)

#if we haven't found any tgz (!!!) we abort the process
[ $TGZNUM -eq 0 ] && {
	echo "";
	echo "No tgz found in $PKGDIR";
	echo "abort the process";
	exit 1;
}


#else...
#remove all files
rm $LOGDIR/* &> /dev/null
rm $MISDIR/* &> /dev/null

#(re)build the dependency list for all binary tgz's
for i in $PKGDIR/*; do
	checkName $i
	[ $? -eq 0 ] && $INSTDIR/builddb $i
	[ $INTERRUPTED -eq 1 ] && break;
done
