mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-25 07:08:13 -07:00
edos2unix.eclass: New eclass, split off from eutils.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
This commit is contained in:
21
eclass/edos2unix.eclass
Normal file
21
eclass/edos2unix.eclass
Normal file
@@ -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-system@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
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user