Gentoo Archives: gentoo-catalyst

From: "M. J. Everitt" <m.j.everitt@×××.org>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] RFC: [PATCH]: Test for presence of distcc before preclean to avoid failure
Date: Wed, 24 Jan 2018 09:28:55
Message-Id: 37bb9d8f-e91d-4ab1-32fc-122a0f2b803d@iee.org
In Reply to: Re: [gentoo-catalyst] RFC: [PATCH]: Test for presence of distcc before preclean to avoid failure by Mike Frysinger
1 On 24/01/18 03:45, Mike Frysinger wrote:
2 > On 24 Jan 2018 00:13, M. J. Everitt wrote:
3 >> --- a/targets/stage3/stage3-preclean-chroot.sh
4 >> +++ b/targets/stage3/stage3-preclean-chroot.sh
5 >> @@ -11,7 +11,10 @@ cleanup_stages
6 >>
7 >> if [ -n "${clst_DISTCC}" ]
8 >> then
9 >> - run_merge -C sys-devel/distcc || exit 1
10 >> + portageq match / sys-devel/distcc 2>&1 | grep -s -q distcc
11 > just do a -n test on the output instead
12 >
13 > although seems like portageq should be better with its exit status
14 Thanks Mike - I did take a look at the portageq source code, but after
15 consulting with Zac, we decided against changing exit codes at this
16 time, to preserve the [minimal] existing return code behaviour. I agree,
17 for this purpose, it would seem much more sensible, though, to simply
18 have a grep-like exit code to test straight-off ... Added to FEATUREREQ ;)
19 >> + if [ $? == 0 ]; then
20 > use `[[` instead of `[` when writing bash, especially when using
21 > bash code like "==".
22 > -mike
23 Ooops, I usually do double-brackets - the curse of late-night coding .. :D
24
25 Michael.

Attachments

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