eclipse_log=$1
source_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

packages_as_string=`cat $eclipse_log | grep osgi.identity= | sed -r 's/^.*osgi.identity="([^"]*).*/\1/g' | sort | uniq `

declare -a packages=(`echo ${packages_as_string}`);

for package in "${packages[@]}"
do
   	echo "Package: $package"
	echo	
	echo "/opt/rh/rh-eclipse47:"
	find /opt/rh/rh-eclipse47/ -iname "$package\_*" 2>/dev/null
	echo
	echo "~/.eclipse:"
	find ~/.eclipse/org.eclipse.platform_1565164387_linux_gtk_x86_64/ -iname "$package\_*"
	echo "----------------------------------------------------------"
done | tee $source_dir/packages.txt

