#!/bin/sh
SLINT=/storage/repo/x86_64/slint-14.2.1/slint
TESTING=/storage/repo/x86_64/slint-testing/slint
SLACK=/data/slackware64-14.2/
(cd $SLINT; ls *txz|sort|sed s/slint.txz//)> slint_packages
(cd $TESTING; ls *txz|sort|sed s/slint.txz//)> testing_packages
cat slint_packages|sed s/-[^-]*-[^-]*-[^-]*$// > slint_short_names
cat testing_packages|sed s/-[^-]*-[^-]*-[^-]*$// > testing_short_names
for i in $(<testing_short_names); do
	if ! grep -q $i slint_packages; then
		echo $i
	fi
done>added_to_slint_repository
echo "done>added_to_slint_repository"
for i in $(<testing_short_names); do
	if ! grep -q $i slint_packages && \
	[ "$(find $SLACK -name ${i}*txz)" = "" ]; then
		echo $i
	fi
done>added_to_slint_distribution
echo "done>added_to_slint_distribution"
for i in $(<testing_short_names); do
	if ! grep -q $i slint_packages && \
	[ ! "$(find $SLACK -name ${i}*txz)" = "" ]; then
		echo $i
	fi
done>newly_migrated_from_slackware
echo "done>newly_migrated_from_slackware"
for i in $(<testing_short_names); do
	if grep -q $i slint_packages && \
	[ ! "$(grep $i slint_packages)" = "$(grep $i testing_packages)" ]; then
		echo $i
	fi
done>upgraded
echo "done>upgraded"
for i in $(<slint_short_names); do
	if ! grep -q $i testing_packages; then
		echo $i
	fi
done>removed
echo "done>removed"
echo "All done."
 
