edos2unix now dies when sed fails
authorMike Frysinger <vapier@gentoo.org>
Fri, 30 Sep 2011 16:51:01 +0000 (16:51 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 30 Sep 2011 16:51:01 +0000 (16:51 +0000)
eclass/eutils.eclass

index 92490ff96729d42ed1c9912659a1f89bbad85c27..ac6f6849490bfb1bf89c423f128a54ac2ccf2549 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.365 2011/09/29 02:32:20 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.366 2011/09/30 16:51:01 vapier Exp $
 
 # @ECLASS: eutils.eclass
 # @MAINTAINER:
@@ -919,7 +919,8 @@ enewgroup() {
 # 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() {
-       echo "$@" | xargs sed -i 's/\r$//'
+       [[ $# -eq 0 ]] && return 0
+       sed -i 's/\r$//' -- "$@" || die
 }
 
 # Make a desktop file !