Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 02 Mar 2018 08:35:45
Message-Id: 1519979603.437fa331a8d9ed4259949e3731b2eab330b69f2a.ulm@gentoo
1 commit: 437fa331a8d9ed4259949e3731b2eab330b69f2a
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 16 06:47:46 2018 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 2 08:33:23 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=437fa331
7
8 eutils.eclass: More reliable return status for e*_clean functions.
9
10 In ecvs_clean, combine the two find commands into one, so that the
11 exit status of the first one won't be ignored.
12
13 Also use find -exec rather then find | xargs, so we don't have to
14 check the exit status of all commands in the pipeline.
15
16 eclass/eutils.eclass | 8 ++++----
17 1 file changed, 4 insertions(+), 4 deletions(-)
18
19 diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
20 index 8bbd561015a..0a5bf385358 100644
21 --- a/eclass/eutils.eclass
22 +++ b/eclass/eutils.eclass
23 @@ -44,8 +44,8 @@ fi
24 # internal CVS directories. Defaults to $PWD.
25 ecvs_clean() {
26 [[ $# -eq 0 ]] && set -- .
27 - find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf
28 - find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf
29 + find "$@" '(' -type d -name 'CVS' -prune -o -type f -name '.cvs*' ')' \
30 + -exec rm -rf '{}' +
31 }
32
33 # @FUNCTION: esvn_clean
34 @@ -55,7 +55,7 @@ ecvs_clean() {
35 # internal Subversion directories. Defaults to $PWD.
36 esvn_clean() {
37 [[ $# -eq 0 ]] && set -- .
38 - find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
39 + find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' +
40 }
41
42 # @FUNCTION: egit_clean
43 @@ -65,7 +65,7 @@ esvn_clean() {
44 # contains internal Git directories. Defaults to $PWD.
45 egit_clean() {
46 [[ $# -eq 0 ]] && set -- .
47 - find "$@" -type d -name '.git*' -prune -print0 | xargs -0 rm -rf
48 + find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' +
49 }
50
51 # @FUNCTION: emktemp