post_upgrade() {
	if usr/bin/pacman-key -l >/dev/null 2>&1; then
		usr/bin/pacman-key --populate archlinux

		# Re-enable key of dwallace
		# See https://bugs.archlinux.org/task/35478
		if [ -z "$2" ] || [ "$2" = "20130525-1" ]; then
			printf 'enable\nquit\n' | LANG=C \
				gpg --homedir /etc/pacman.d/gnupg \
				--no-permission-warning --command-fd 0 \
				--quiet --batch --edit-key \
				5559BC1A32B8F76B3FCCD9555FA5E5544F010D48 \
				2>/dev/null
		fi
	fi
}

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