#!/bin/sh

# Author: Athos Ribeiro <athos.ribeiro@canonical.com>

# Ensure that the PHP_EXTRA_VERSION is being set with the debian version

PKGVERSION=$(dpkg-query --showformat='${Version}\n' --show php8.2-cli)
PHPVERSION=$(php8.2 --version | head -1 | cut -d ' ' -f2)

if [ "${PKGVERSION}" != "${PHPVERSION}" ]; then
	echo "package version ${PKGVERSION} does not match php CLI version ${PHPVERSION}"
	exit 1
fi
