#!/bin/sh
#
# Figure out new obsolete lists.
#
# Run this from .../distrib/sets/lists/<foo>
#
# output: <list>.obnew

LISTS="ad.* md* mi shl.*"
echo $LISTS
for list in $LISTS; do
	if [ ! -f $list ] ; then
		continue
	fi

# argh, not all lists have rcsids
#	ver=`head -1 $list | sed -e's/^#//' | awk ' { print $3 }' | sed -e's/^1\.//'`
	ver=`cat CVS/Entries | grep "^/$list" | awk ' BEGIN { FS="/" } { print $3 } ' | sed -e's/^1\.//'`

	# Make sure the file has a version to work with.
	if [ -z $ver ] ; then
		continue
	fi

	touch $list.ob
	while [ $ver -gt 1 ] ; do
		ver=$(($ver - 1))
		echo Diff against version 1.$ver
		cvs diff -u -r1.$ver $list  >> $list.ob
	done

	grep "^-[^-]" $list.ob | sed -e's/^-//' | sort | uniq | \
		grep -v "^#" | sed -e's/^\.//' > $list.obnew
	rm $list.ob
done
