#!/bin/sh -x

# run lintian on generated changes files
apt-get install -y --force-yes lintian >/dev/null 2>&1

# hardcoded here since it's a current practise to build for different releases (as codenames)
LINTIAN_DELETE_TAG="bad-distribution-in-changes-file"

# Add options --suppress-tags in lintian from 2.3 version
if [ "$(lintian --version)" > "Lintian v2.3" ]; then
	SUPPRESS_TAGS="--suppress-tags ${LINTIAN_DELETE_TAG}"
fi

su -c "lintian -vi $SUPPRESS_TAGS --show-overrides $HOME/*.changes" nobody || true
