#!/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 a.pkgid from RPM_SCRIPTS_POSTIN as a left join rpm_files as b where (POSTIN glob '*service*httpd2*' or POSTIN glob '*init.d/httpd2*' or POSTIN glob '*apachectl2*') and a.pkgid=b.pkgid and (filename glob '/etc/httpd2/*' or filename glob '/usr/lib64/apache2/modules/*') and not a.pkgid glob 'apache2-base-*' ORDER BY a.pkgid;
EOSQL
for i in `cat $REPOCOP_TEST_TMPDIR/msg`; do repocop-test-info -k $i "This package contains httpd2 restart/reload calls in its post/un scripts. But those calls are deprecated by httpd2.filetrigger that activates by files in /etc/httpd2/ or %_libdir/apache2/modules/. It should be safe to remove those calls and rely on the filetrigger instead." ; done
rm $REPOCOP_TEST_TMPDIR/*
