#!/bin/sh
set -e -u -x

debputy --no-pager --help
debputy --no-pager check-manifest

debputy --no-pager plugin --help
debputy --no-pager plugin list --help

debputy --no-pager plugin list
debputy --no-pager plugin list plugins
debputy --no-pager plugin list ppf
debputy --no-pager plugin list manifest-variables
debputy --no-pager plugin list manifest-variables --show-all-variables
debputy --no-pager plugin list pmr

debputy --no-pager plugin show pmr --help
echo "Checking installations manifest rules"
for rule in install install-docs install-man discard ; do
  debputy --no-pager plugin show pmr "${rule}"
done

echo "Checking binary package transformations manifest rules"
for rule in TransformationRule::remove move create-symlink path-metadata create-directories; do
  debputy --no-pager plugin show pmr "${rule}"
done

for variable in DEB_SOURCE token:TAB DEB_HOST_ARCH DEB_BUILD_ARCH; do
  debputy --no-pager plugin show manifest-variables "${variable}"
done
