#!/bin/sh
cat > "$REPOCOP_TEST_TMPDIR/tmp.sql" <<EOSQL
.mode tabs
.output $REPOCOP_TEST_TMPDIR/msg
select a.pkgid, requirename from rpm_requires as a left join rpm_provides as b on REQUIRENAME = b.PROVIDENAME where PROVIDENAME is NULL and substr(requirename,1,1)<>'/' and requirename not glob '*(*)';
EOSQL
repocop-sqlite "$REPOCOP_DISTROTEST_DBDIR/rpm.db" < "$REPOCOP_TEST_TMPDIR/tmp.sql"
perl -ne 'chomp;@a=split /\t/;system("repocop-test-fail", "-k", $a[0], "install dependency $a[1] not found.")' $REPOCOP_TEST_TMPDIR/msg
rm $REPOCOP_TEST_TMPDIR/*
