#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/warn
select pkgid, filename from rpm_files where filename glob '*/Thumbs.db*';
EOSQL
cat > $REPOCOP_TEST_TMPDIR/repocop.awk <<'EOF'
BEGIN {FS="\t"}
// {system("repocop-test-warn -k " $1 " '" $2 ": It is the file in the package named <tt>Thumbs.db</tt> or <tt>Thumbs.db.gz</tt>, which is normally a Windows image thumbnail database. Such databases are generally useless in packages and were usually accidentally included by copying complete directories from the source tarball.'")}
EOF
cat $REPOCOP_TEST_TMPDIR/warn | awk -f $REPOCOP_TEST_TMPDIR/repocop.awk
rm $REPOCOP_TEST_TMPDIR/*
