#!/bin/sh

set -e

# Block regression Bug#1036575

# Ignore libc6, libgroonga0
PKG_DEPENDS=`dpkg-query --show --showformat='${Depends}' groonga-bin | cut -d ',' -f3-`
if [ "$PKG_DEPENDS" = " libjs-jquery, libjs-jquery-ui, libjs-jquery-flot" ]; then
    echo "run: groonga-bin satisfy package dependency to <$PKG_DEPENDS>"
else
    echo "run: groonga-bin does not satisfy dependency to <$PKG_DEPENDS>"
    exit 1
fi

PKG_DEPENDS=`dpkg-query --show --showformat='${Depends}' groonga-doc`
if [ "$PKG_DEPENDS" = "libjs-bootstrap, libjs-underscore, libjs-jquery, python3-pydata-sphinx-theme" ]; then
    echo "run: groonga-doc satisfy package dependency to <$PKG_DEPENDS>"
else
    echo "run: groonga-doc does not satisfy dependency to <$PKG_DEPENDS>"
    exit 1
fi
