Re: [PATCH 5/5] travis-ci: don't fail if user already exists on 32 bit Linux build job
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Jan 24, 2018, 19:39 UTC
- Message-ID
- <CAM0VKjms5jRJj8=yD25cREkjn309tnnje4XhUAY1V1+OKWmgfg@mail.gmail.com>
- In-Reply-To
- <20180123164605.GH13068@sigill.intra.peff.net>
On Tue, Jan 23, 2018 at 5:46 PM, Jeff King <peff@peff.net> wrote:
> On Mon, Jan 22, 2018 at 02:32:20PM +0100, SZEDER Gábor wrote:
Show 18 quoted lines
>> diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh >> index e37e1d2d5f..13047adde3 100755 >> --- a/ci/run-linux32-build.sh >> +++ b/ci/run-linux32-build.sh >> @@ -33,7 +33,13 @@ then >> CI_USER=root >> else >> CI_USER=ci >> - useradd -u $HOST_UID $CI_USER >> + if test "$(id -u $CI_USER)" = $HOST_UID >> + then >> + : # user already exists with the right ID >> + else >> + useradd -u $HOST_UID $CI_USER >> + fi > > Is it worth redirecting the stderr of "id" to avoid noise when $CI_USER > does not yet exist at all? Or is that a useful log message? :)
I think it's worth silencing that error. I'm not even sure it was useful while working on this patch series, but an error message in the middle of the log of a successful build job is surely distracting and might raise some eyebrows (though I suspect that barely anyone looks at logs of successful build jobs).
OTOH, I might turn that comment into an echo msg...