Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/dos2unix/
Date: Mon, 28 Mar 2016 22:03:55
Message-Id: 1459202625.34056a95fa0636621ef6f7b85e398e21b4cdf1e9.vapier@gentoo
1 commit: 34056a95fa0636621ef6f7b85e398e21b4cdf1e9
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 28 21:56:39 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 22:03:45 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34056a95
7
8 app-text/dos2unix: respect LINGUAS via l10n.eclass
9
10 app-text/dos2unix/dos2unix-7.3.3.ebuild | 23 ++++++++++++++++++++++-
11 1 file changed, 22 insertions(+), 1 deletion(-)
12
13 diff --git a/app-text/dos2unix/dos2unix-7.3.3.ebuild b/app-text/dos2unix/dos2unix-7.3.3.ebuild
14 index 97a70f0..5d49f87 100644
15 --- a/app-text/dos2unix/dos2unix-7.3.3.ebuild
16 +++ b/app-text/dos2unix/dos2unix-7.3.3.ebuild
17 @@ -4,7 +4,9 @@
18
19 EAPI=6
20
21 -inherit toolchain-funcs
22 +PLOCALES="da de eo es fr hu ja nb nl pl pt_BR ru sr sv uk vi zh_CN zh_TW"
23 +
24 +inherit l10n toolchain-funcs
25
26 DESCRIPTION="Convert DOS or MAC text files to UNIX format or vice versa"
27 HOMEPAGE="http://www.xs4all.nl/~waterlan/dos2unix.html http://sourceforge.net/projects/dos2unix/"
28 @@ -27,9 +29,28 @@ DEPEND="
29 test? ( virtual/perl-Test-Simple )
30 dev-lang/perl"
31
32 +handle_locales() {
33 + # Make sure locale list is kept up-to-date.
34 + local detected sorted
35 + detected=$(echo $(printf '%s\n' */*.po | sed -e 's:.*/::' -e 's:.po$::' | sort -u))
36 + sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
37 + if [[ ${sorted} != "${detected}" ]] ; then
38 + eerror "The ebuild needs to be kept in sync."
39 + eerror "PLOCALES: ${sorted}"
40 + eerror "po*/*.po: ${detected}"
41 + die "sync PLOCALES"
42 + fi
43 +
44 + # Deal with selective install of locales.
45 + rm_loc() { rm po*/$1.po || die; }
46 + l10n_for_each_disabled_locale_do rm_loc
47 +}
48 +
49 src_prepare() {
50 default
51
52 + handle_locales
53 +
54 sed \
55 -e '/^LDFLAGS/s|=|+=|' \
56 -e '/CFLAGS_OS \+=/d' \