diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-09-07 01:46:14 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-09-07 01:49:17 -0400 |
commit | 479c7935881a5cd6f7ec560918f74245e73111f8 (patch) | |
tree | 49c321e2d0efc0e343ca1bb9c2c9bf7a5281605c /app-emulation/qemu/qemu-9999.ebuild | |
parent | app-emulation/qemu: update seabios pin to version 1.8.2 (diff) | |
download | gentoo-479c7935881a5cd6f7ec560918f74245e73111f8.tar.gz gentoo-479c7935881a5cd6f7ec560918f74245e73111f8.tar.bz2 gentoo-479c7935881a5cd6f7ec560918f74245e73111f8.zip |
app-emulation/qemu: add target sanity checks
This way we know up front when a new target appears rather than when
someone happens to check & notice.
Diffstat (limited to 'app-emulation/qemu/qemu-9999.ebuild')
-rw-r--r-- | app-emulation/qemu/qemu-9999.ebuild | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild index b95be31a1969..9a8f7bd119c4 100644 --- a/app-emulation/qemu/qemu-9999.ebuild +++ b/app-emulation/qemu/qemu-9999.ebuild @@ -268,7 +268,29 @@ pkg_setup() { enewgroup kvm 78 } +# Sanity check to make sure target lists are kept up-to-date. +check_targets() { + local var=$1 mak=$2 + local detected sorted + + pushd "${S}"/default-configs >/dev/null || die + + detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | sort -u)) + sorted=$(echo $(printf '%s\n' ${!var} | sort -u)) + if [[ ${sorted} != "${detected}" ]] ; then + eerror "The ebuild needs to be kept in sync." + eerror "${var}: ${sorted}" + eerror "$(printf '%-*s' ${#var} configure): ${detected}" + die "sync ${var} to the list of targets" + fi + + popd >/dev/null +} + src_prepare() { + check_targets IUSE_SOFTMMU_TARGETS softmmu + check_targets IUSE_USER_TARGETS linux-user + # Alter target makefiles to accept CFLAGS set via flag-o sed -i -r \ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ |