#!/bin/sh
sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <<EOSQL
attach database '$REPOCOP_DISTROTEST_DBDIR/rpm-ext.db' as rpmext;
.mode tabs
.output $REPOCOP_TEST_TMPDIR/msg
SELECT obsoleter, obsoletee FROM explicit_obsolete;
EOSQL
perl -ne 'chomp;@a=split /\t/;system(qw/repocop-test-info -k/,$a[0], "The package obsoletes the package $a[1], but the package $a[1] is still alive and in the repository. Ask its maintainer to remove it, or, if it should not be removed, remove the Obsoletes: tag. Do not forget to add explicit conflicts with the other package if nessessary."); system(qw/repocop-test-warn -t rpm-package-is-obsoleted -k/,$a[1], "The package is  obsoleted by the package $a[0], but is still alive and in the repository. Consider removing the package, or, if you want the package to be alive, ask the maintainer of $a[0] to remove Obsoletes: tag.")' $REPOCOP_TEST_TMPDIR/msg
rm $REPOCOP_TEST_TMPDIR/*
