Gentoo Archives: gentoo-dev

From: Ionen Wolkens <ionen@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [PATCH 1/1] edo.eclass: add new eclass
Date: Sat, 16 Apr 2022 10:49:17
Message-Id: YlqfGIyGribtxpxs@eversor
In Reply to: Re: [gentoo-dev] Re: [PATCH 1/1] edo.eclass: add new eclass by Florian Schmaus
1 On Sat, Apr 16, 2022 at 12:23:18PM +0200, Florian Schmaus wrote:
2 > > ebegin "Running $@"
3 > > "$@"
4 > > eend $? || die -n "$@ failed" > return $?
5 >
6 > I think this return statement can be omitted since it will always be
7 > invoked with 0 as argument, and this is the default behavior of implicit
8 > function return (IIRC).
9
10 Not with nonfatal (die is using -n to allow it)
11
12 nonfatal edo false || echo "different error handling: $?"
13
14 Without return $?, the above will echo 0 or 1 if die was triggered
15 but (with current implementation) won't be the actual return code.
16
17 That still mostly work but maybe, e.g. the code need to check if
18 grep returned 2 (aka error) while 1 isn't an error but just didn't
19 match anything.
20
21 --
22 ionen

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Re: [PATCH 1/1] edo.eclass: add new eclass Ionen Wolkens <ionen@g.o>