/etc/piuparts/scripts/pre_remove_40_find_obsolete_conffiles is in piuparts 0.62+deb8u1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/bin/sh
set -e
for pkg in ${PIUPARTS_OBJECTS%%=*}
do
dpkg-query -W -f='${Conffiles}\n' $pkg | \
grep ' obsolete$' | \
while read file md5expected obs
do
info="OBSOLETE CONFFILE $file REGISTERED BY $pkg"
query=$(dpkg-query -S $file)
owner=${query%: ${file}}
if [ "$owner" != "$pkg" ]; then
info="${info} OWNER CHANGED TO $owner"
fi
if [ ! -f "$file" ]; then
info="${info} (MISSING)"
else
md5=$(md5sum "$file" | awk '{ print $1 }')
if [ "$md5expected" != "$md5" ]; then
info="${info} (MODIFIED)"
fi
fi
echo "$info"
done
done
|