diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-03-28 17:56:39 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-03-28 18:03:45 -0400 |
commit | 34056a95fa0636621ef6f7b85e398e21b4cdf1e9 (patch) | |
tree | e1ebe9475be022bf03f2f72a6d515b8156074e22 /app-text/dos2unix | |
parent | 4c5c6101bcd14edd6a1a0cee11a3448b26d5ec2c (diff) | |
download | gentoo-34056a95fa0636621ef6f7b85e398e21b4cdf1e9.tar.gz gentoo-34056a95fa0636621ef6f7b85e398e21b4cdf1e9.tar.xz |
app-text/dos2unix: respect LINGUAS via l10n.eclass
Diffstat (limited to 'app-text/dos2unix')
-rw-r--r-- | app-text/dos2unix/dos2unix-7.3.3.ebuild | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/app-text/dos2unix/dos2unix-7.3.3.ebuild b/app-text/dos2unix/dos2unix-7.3.3.ebuild index 97a70f05776..5d49f876df1 100644 --- a/app-text/dos2unix/dos2unix-7.3.3.ebuild +++ b/app-text/dos2unix/dos2unix-7.3.3.ebuild @@ -4,7 +4,9 @@ EAPI=6 -inherit toolchain-funcs +PLOCALES="da de eo es fr hu ja nb nl pl pt_BR ru sr sv uk vi zh_CN zh_TW" + +inherit l10n toolchain-funcs DESCRIPTION="Convert DOS or MAC text files to UNIX format or vice versa" HOMEPAGE="http://www.xs4all.nl/~waterlan/dos2unix.html http://sourceforge.net/projects/dos2unix/" @@ -27,9 +29,28 @@ DEPEND=" test? ( virtual/perl-Test-Simple ) dev-lang/perl" +handle_locales() { + # Make sure locale list is kept up-to-date. + local detected sorted + detected=$(echo $(printf '%s\n' */*.po | sed -e 's:.*/::' -e '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. + rm_loc() { rm po*/$1.po || die; } + l10n_for_each_disabled_locale_do rm_loc +} + src_prepare() { default + handle_locales + sed \ -e '/^LDFLAGS/s|=|+=|' \ -e '/CFLAGS_OS \+=/d' \ |