msg() {
    local ALL_OFF="\e[1;0m"
    local BOLD="\e[1;1m"
    local GREEN="${BOLD}\e[1;32m"

    local MESSAGE=$1
    shift 1
    printf "${GREEN}==>${ALL_OFF}${BOLD} ${MESSAGE}${ALL_OFF}\n" "$@" >&2
}

#pre_upgrade() {
#	if [[ "$(vercmp $2 1.0-1)" -lt 0 ]]; then
#		msg "Delete wrongly disabled keys"
#		pacman-key -d 0101010101010101010101010101010101101010
#	fi
#	if [[ "$(vercmp $2 1.2-1-lt 0 ]]; then
#		msg "Delete expired Key by Jonas Strassel"
#		pacman-key -d 0101010101010101010101010101010101101010#
#	fi
#}

post_upgrade() {
	if usr/bin/pacman-key -l >/dev/null 2>&1; then
		usr/bin/pacman-key --populate delinuxco
	else
		echo " >>> Run \`pacman-key --init\` to set up your pacman keyring."
		echo " >>> Then run \`pacman-key --populate delinuxco\` to install the delinuxco keyring."
	fi
}

post_install() {
	if [ -x usr/bin/pacman-key ]; then
		post_upgrade
	fi
}
