#!/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 php7.4-cli)
PHPVERSION=$(php7.4 --version | head -1 | cut -d ' ' -f2)

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