From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A66DE59CAA for ; Mon, 28 Mar 2016 21:41:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D9BBB21C002; Mon, 28 Mar 2016 21:41:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 575BB21C002 for ; Mon, 28 Mar 2016 21:41:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C509C340BB9 for ; Mon, 28 Mar 2016 21:41:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8A8B785D for ; Mon, 28 Mar 2016 21:41:23 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1459201270.42da3c45bbe074f8d25decfcdd7cd8d0388c6f39.vapier@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-emulation/qemu/qemu-2.5.0-r2.ebuild app-emulation/qemu/qemu-9999.ebuild X-VCS-Directories: app-emulation/qemu/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 42da3c45bbe074f8d25decfcdd7cd8d0388c6f39 X-VCS-Branch: master Date: Mon, 28 Mar 2016 21:41:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 28303d77-50f9-4667-93fd-2e1f4070430b X-Archives-Hash: 3acc6d926fd7b097df3fcdb1659dc1a1 commit: 42da3c45bbe074f8d25decfcdd7cd8d0388c6f39 Author: Mike Frysinger gentoo org> AuthorDate: Mon Mar 28 21:38:33 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Mar 28 21:41:10 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42da3c45 app-emulation/qemu: use l10n.eclass to respect LINGUAS #577814 app-emulation/qemu/qemu-2.5.0-r2.ebuild | 33 +++++++++++++++++++++++++++++---- app-emulation/qemu/qemu-9999.ebuild | 33 +++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/app-emulation/qemu/qemu-2.5.0-r2.ebuild b/app-emulation/qemu/qemu-2.5.0-r2.ebuild index 5621047..072691e 100644 --- a/app-emulation/qemu/qemu-2.5.0-r2.ebuild +++ b/app-emulation/qemu/qemu-2.5.0-r2.ebuild @@ -7,8 +7,10 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="ncurses,readline" +PLOCALES="de_DE fr_FR hu it tr zh_CN" + inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ - user udev fcaps readme.gentoo pax-utils + user udev fcaps readme.gentoo pax-utils l10n BACKPORTS= @@ -295,6 +297,29 @@ check_targets() { popd >/dev/null } +handle_locales() { + # Make sure locale list is kept up-to-date. + local detected sorted + detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) + sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) + if [[ ${sorted} != "${detected}" ]] ; then + eerror "The ebuild needs to be kept in sync." + eerror "PLOCALES: ${sorted}" + eerror " po/*.po: ${detected}" + die "sync PLOCALES" + fi + + # Deal with selective install of locales. + if use nls ; then + # Delete locales the user does not want. #577814 + rm_loc() { rm po/$1.po || die; } + l10n_for_each_disabled_locale_do rm_loc + else + # Cheap hack to disable gettext .mo generation. + rm -f po/*.po + fi +} + src_prepare() { check_targets IUSE_SOFTMMU_TARGETS softmmu check_targets IUSE_USER_TARGETS linux-user @@ -304,9 +329,6 @@ src_prepare() { -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ Makefile Makefile.target || die - # Cheap hack to disable gettext .mo generation. - use nls || rm -f po/*.po - epatch "${FILESDIR}"/qemu-2.5.0-cflags.patch [[ -n ${BACKPORTS} ]] && \ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \ @@ -337,6 +359,9 @@ src_prepare() { MAKEOPTS+=" V=1" epatch_user + + # Run after we've applied all patches. + handle_locales } ## diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild index 70f595e..acecad8 100644 --- a/app-emulation/qemu/qemu-9999.ebuild +++ b/app-emulation/qemu/qemu-9999.ebuild @@ -7,8 +7,10 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="ncurses,readline" +PLOCALES="de_DE fr_FR hu it tr zh_CN" + inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ - user udev fcaps readme.gentoo pax-utils + user udev fcaps readme.gentoo pax-utils l10n BACKPORTS= @@ -295,6 +297,29 @@ check_targets() { popd >/dev/null } +handle_locales() { + # Make sure locale list is kept up-to-date. + local detected sorted + detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) + sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) + if [[ ${sorted} != "${detected}" ]] ; then + eerror "The ebuild needs to be kept in sync." + eerror "PLOCALES: ${sorted}" + eerror " po/*.po: ${detected}" + die "sync PLOCALES" + fi + + # Deal with selective install of locales. + if use nls ; then + # Delete locales the user does not want. #577814 + rm_loc() { rm po/$1.po || die; } + l10n_for_each_disabled_locale_do rm_loc + else + # Cheap hack to disable gettext .mo generation. + rm -f po/*.po + fi +} + src_prepare() { check_targets IUSE_SOFTMMU_TARGETS softmmu check_targets IUSE_USER_TARGETS linux-user @@ -304,9 +329,6 @@ src_prepare() { -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ Makefile Makefile.target || die - # Cheap hack to disable gettext .mo generation. - use nls || rm -f po/*.po - epatch "${FILESDIR}"/qemu-2.5.0-cflags.patch [[ -n ${BACKPORTS} ]] && \ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \ @@ -319,6 +341,9 @@ src_prepare() { MAKEOPTS+=" V=1" epatch_user + + # Run after we've applied all patches. + handle_locales } ##