#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
.mode tabs
CREATE TEMPORARY TABLE info(pkgid TEXT);
INSERT INTO info select distinct a.pkgid from rpm_files as a LEFT JOIN rpm_scripts_postin as b ON a.pkgid=b.pkgid  where filename glob '/usr/share/info/*' and (postin is null or (postin not glob '*install_info*' and postin not glob '*install-info*'));
DELETE FROM info WHERE pkgid glob 'bash-*' or  pkgid glob 'gzip-*' or  pkgid glob 'info-install-*';
.output $REPOCOP_TEST_TMPDIR/warn
select pkgid from info;
EOSQL
for i in `cat $REPOCOP_TEST_TMPDIR/warn`; do repocop-test-warn -k $i "There are info files in the package. To install them properly one should use %install_info <names>.
"; done
rm $REPOCOP_TEST_TMPDIR/*
