#!/bin/sh

set -e

# Remove keys from trusted.gpg -- now in trusted.gpg.d/
# (Adapted code from postinst from debian-archive-keyring)
if [ "$1" = 'configure' -a -n "$2" ]; then
	if which gpg > /dev/null && which apt-key > /dev/null; then
		TRUSTEDFILE='/etc/apt/trusted.gpg'
		eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
		eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
		if [ -e "$TRUSTEDFILE" ]; then
			apt-key --keyring "$TRUSTEDFILE" del %KEY_ID% > /dev/null 2>&1 || :
		fi
	fi
fi

#DEBHELPER#
