#!/bin/sh
set -eu

deb_version="$(dpkg-query -W -f='${Version}' python3-vtk9)"

# Strip the epoch and Debian revision, then any Debian repack suffix.
upstream_version="${deb_version#*:}"
upstream_version="${upstream_version%-*}"
expected_version="${upstream_version%%+*}"

actual_version="$(
    python3 -m pip show vtk |
        sed -n 's/^Version: //p'
)"

test -n "$actual_version"
test "$actual_version" = "$expected_version"
