#!/bin/bash

BASEMAN="/usr/share/man"

which apt-file >/dev/null 2>&1
if [ $? -ne 0 ] ; then
	echo "apt-file is required" 1>&2 ;
       	exit 1
fi

echo -e "WARNING: This tool assumes apt-file has been updated based on sid\n" 1>&2 ; 


for j in man*/*.* ;
	do (dpkg -S "$BASEMAN/$j.gz" 2>/dev/null || apt-file search "$BASEMAN/$j.gz") \
		| grep -v '^manpages:' \
		| grep -v '^manpages-dev:' ;
done
