#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_DISTROTEST_DBDIR/rpm.db' as rpm;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/msg
select a.FILENAME, a.pkgid, b.pkgid FROM rpm_files as a, rpm_files as b, rpm as c, rpm as d WHERE a.filename=b.filename and a.pkgid = c.pkgid and b.pkgid = d.pkgid and a.filename glob '*.jar' and c.name<>d.name AND d.name not in (select e.conflictname from rpm_conflicts as e where a.pkgid=e.pkgid) AND c.name not in (select f.conflictname from rpm_conflicts as f where b.pkgid=f.pkgid);
EOSQL
perl -ne 'chomp;@a=split /\t/;system("repocop-test-info -k $a[1] file $a[0] confilicts with package: $a[2]: if the jar do provide the same standard interface, it should be alternative. Otherwise it is recommended to rename the jar")' $REPOCOP_TEST_TMPDIR/msg
rm $REPOCOP_TEST_TMPDIR/*
