#!/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_preun as b ON a.pkgid=b.pkgid  where filename glob '/usr/share/info/*' and (preun is null or (preun not glob '*install_info*' and preun 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 uninstall them properly one should use %uninstall_info <names> in %preun section.
"; done
rm $REPOCOP_TEST_TMPDIR/*
