#!/bin/bash

# /etc/logrotate.d/dpkg always exists

for definition in /etc/logrotate.d/*
do
	#dpkg -S $definition is too slow
	package=${definition##*/}
	case $package in
		alternatives)
			echo ALTERNATIVES
			;;
		btmp|wtmp)
			echo logrotate
			;;
		*)
			echo $package
			;;
	esac

	grep ^/ $definition | while read file bracket
	do
		find /var/log -path "${file}*" 2>/dev/null
	done
done
