python-rpm-generators/tests/pythonabi.sh
Miro Hrončok c3f90ed2e8 Fix reversed grep exit codes in integration tests
grep -v only fails if there are no unmatched lines, but that's not what we want to test.
2020-05-04 13:45:57 +02:00

20 lines
975 B
Bash
Executable File

#!/usr/bin/bash -eux
rpmbuild -ba pythonabi.spec
PYVER=$(rpm --eval '%python3_version')
RPMDIR=$(rpm --eval '%_topdir')/RPMS
ARCH=$(rpm --eval '%_arch')
ABI='^python(abi) = '${PYVER}'$'
rpm -qp --provides ${RPMDIR}/${ARCH}/python-interpreter-0-0.${ARCH}.rpm | grep "${ABI}"
rpm -qp --requires ${RPMDIR}/${ARCH}/python-interpreter-0-0.${ARCH}.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --requires ${RPMDIR}/${ARCH}/python-arched-0-0.${ARCH}.rpm | grep "${ABI}"
rpm -qp --provides ${RPMDIR}/${ARCH}/python-arched-0-0.${ARCH}.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --requires ${RPMDIR}/noarch/python-noarch-0-0.noarch.rpm | grep "${ABI}"
rpm -qp --provides ${RPMDIR}/noarch/python-noarch-0-0.noarch.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --provides ${RPMDIR}/${ARCH}/python-misplaced-interpreter-0-0.${ARCH}.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --requires ${RPMDIR}/noarch/python-misplaced-library-0-0.noarch.rpm | grep "${ABI}" && exit 1 || true