commit: 80f9e1b4058fddc6df645f36c06367a676a11cbe Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Wed Sep 9 15:16:27 2020 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Sat Sep 12 16:02:58 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80f9e1b4
edos2unix.eclass: New eclass, split off from eutils. Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> eclass/edos2unix.eclass | 21 +++++++++++++++++++++ eclass/eutils.eclass | 18 +++--------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/eclass/edos2unix.eclass b/eclass/edos2unix.eclass new file mode 100644 index 00000000000..8b774844cb8 --- /dev/null +++ b/eclass/edos2unix.eclass @@ -0,0 +1,21 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: edos2unix.eclass +# @MAINTAINER: +# base-sys...@gentoo.org +# @BLURB: convert files from DOS CRLF to UNIX LF line endings + +# @FUNCTION: edos2unix +# @USAGE: <file> [more files ...] +# @DESCRIPTION: +# A handy replacement for dos2unix, recode, fixdos, etc... This allows +# you to remove all of these text utilities from DEPEND variables +# because this is a script based solution. Just give it a list of files +# to convert and they will all be changed from the DOS CRLF format to +# the UNIX LF format. + +edos2unix() { + [[ $# -eq 0 ]] && return 0 + sed -i 's/\r$//' -- "$@" || die +} diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index f74074fb4f1..3b3e328ba30 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -21,10 +21,10 @@ _EUTILS_ECLASS=1 # implicitly inherited (now split) eclasses case ${EAPI:-0} in 0|1|2|3|4|5|6) - inherit desktop epatch estack ltprune multilib preserve-libs \ - toolchain-funcs vcs-clean + inherit desktop edos2unix epatch estack ltprune multilib \ + preserve-libs toolchain-funcs vcs-clean ;; - 7) ;; + 7) inherit edos2unix ;; *) die "${ECLASS} is banned in EAPI ${EAPI}" ;; esac @@ -63,18 +63,6 @@ emktemp() { fi } -# @FUNCTION: edos2unix -# @USAGE: <file> [more files ...] -# @DESCRIPTION: -# A handy replacement for dos2unix, recode, fixdos, etc... This allows you -# to remove all of these text utilities from DEPEND variables because this -# is a script based solution. Just give it a list of files to convert and -# they will all be changed from the DOS CRLF format to the UNIX LF format. -edos2unix() { - [[ $# -eq 0 ]] && return 0 - sed -i 's/\r$//' -- "$@" || die -} - # @FUNCTION: strip-linguas # @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>] # @DESCRIPTION: