#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/msg
select distinct pkgid from rpm_files where filename glob '*/._*';
EOSQL
for i in `cat $REPOCOP_TEST_TMPDIR/msg`; do repocop-test-warn -k $i "There is a file in the package with a name starting with <tt>._</tt>, the file name pattern used by Mac OS X to store resource forks in non-native file systems.  Such files are generally useless in packages and were usually accidentally included by copying complete directories from the source tarball."; done
rm $REPOCOP_TEST_TMPDIR/*
