#!/bin/sh
CHECKTYPE="CONFIG DOC MISSINGOK NOREPLACE GHOST"
for config_type in $CHECKTYPE
do
eval num_${config_type}=$(python -c "import rpm; print rpm.RPMFILE_$config_type")
done
rpm -q --qf '[%{FILEFLAGS} %{FILENAMES}\n]' bash | sort -k 2 | while read line
do
config_value=$(echo $line | sed -e 's| .*$||')
filename=$(echo $line | sed -e 's|^.* ||')
for config_type in $CHECKTYPE
do
eval num_type=\$num_${config_type}
if [ $(($config_value & $num_type)) -gt 0 ]
then
echo -n "$config_type "
fi
done
echo -e "\t $filename"
done