#!/bin/sh

. patchfns 2>/dev/null ||
. /usr/lib/patch-scripts/patchfns 2>/dev/null ||
. $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null ||
{
	echo "Impossible to find my library 'patchfns'."
	echo "Check your install, or go to the right directory"
	exit 1
}

while read x
do
	if echo $x | grep '^+.*' > /dev/null
	then
		echo $x
		echo
		patch_name=$(echo $x | sed -e 's/.\(.*\)\.patch/\1/')
		if [ -e $P/txt/$patch_name.txt ]
		then
			echo -n " "
			head -2 $P/txt/$patch_name.txt | tail -1
			echo
		fi
	fi
	if echo $x | grep '^-.*' > /dev/null
	then
		echo $x
		echo
	fi
done
