#!/bin/sh
sqlite3 "$REPOCOP_TEST_DBDIR/freedesktop-desktop.db" <<EOSQL
-- # attach database '$REPOCOP_TEST_DBDIR/rpm.db' as rpm;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/msg
select pkgid,DESKTOPDIR,DESKTOPFILE from freedesktop_desktop where desktoptype='Application' and DESKTOPDIR not glob '/usr/share/applications*' and DESKTOPDIR not glob '/usr/share/kde*/applications*' and DESKTOPDIR not glob '/usr/share/applnk*' and DESKTOPDIR not glob '/usr/share/kf*/applications*';
EOSQL
perl -ne 'chomp;@a=split /\t/;system("repocop-test-fail", "-k", $a[0], "$a[1]/$a[2] has Type=Application and should be placed under /usr/share/applications.") if $a[0]' $REPOCOP_TEST_TMPDIR/msg
rm $REPOCOP_TEST_TMPDIR/msg
