From: | Ulrich Mueller <ulm@g.o> | ||
---|---|---|---|
To: | Sam James <sam@g.o> | ||
Cc: | gentoo-dev@l.g.o, qa@g.o, pms@g.o | ||
Subject: | [gentoo-dev] Re: [PATCH 1/1] edo.eclass: add new eclass | ||
Date: | Sat, 16 Apr 2022 09:03:08 | ||
Message-Id: | ufsmdtocp@gentoo.org | ||
In Reply to: | [gentoo-dev] [PATCH 1/1] edo.eclass: add new eclass by Sam James |
1 | >>>>> On Sat, 16 Apr 2022, Sam James wrote: |
2 | |
3 | > +# @FUNCTION: edo |
4 | |
5 | Just a remark: A similar command existed a long time ago under the |
6 | name "try". [1] |
7 | |
8 | It was executed under "env" [2], should we also do that? |
9 | |
10 | > +# @USAGE: command [arg1 [arg2 ...]] |
11 | |
12 | <command> should be in angle brackets, if we follow the usual |
13 | convention. Maybe even "<command> [arg]..." |
14 | |
15 | > +# @DESCRIPTION: |
16 | > +# Executes 'command' with any given arguments and exits on failure unless |
17 | > +# called under 'nonfatal'. |
18 | > +edo() { |
19 | > + elog "$@" |
20 | > + "$@" || die -n "Failed to run command: $@ failed" |
21 | > +} |
22 | |
23 | Maybe add an ebegin/eend variant? |
24 | |
25 | edobe() { |
26 | ebegin "Running $@" |
27 | "$@" |
28 | eend $? || die -n "$@ failed" |
29 | return $? |
30 | } |
31 | |
32 | Ulrich |
33 | |
34 | [1] https://gitweb.gentoo.org/archive/proj/portage-cvs.git/tree/bin/ebuild.sh?id=b7c9c02ee04ae62068f8db775c1189fd796cd797#n85 |
35 | [2] https://gitweb.gentoo.org/archive/repo/gentoo-2.git/commit/?id=e5168d05cad140ecd7e966bce3f771003e6d392b |
File name | MIME type |
---|---|
signature.asc | application/pgp-signature |
Subject | Author |
---|---|
Re: [gentoo-dev] Re: [PATCH 1/1] edo.eclass: add new eclass | Florian Schmaus <flow@g.o> |