Re: [PATCH 3/5] travis-ci: don't repeat the path of the cache directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 23, 2018 at 5:30 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Mon, Jan 22, 2018 at 02:32:18PM +0100, SZEDER Gábor wrote:

>> diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh
>> index 248183982b..c9476d6598 100755
>> --- a/ci/run-linux32-build.sh
>> +++ b/ci/run-linux32-build.sh
>> @@ -25,10 +25,10 @@ CI_USER=$USER
>>  test -z $HOST_UID || (CI_USER="ci" && useradd -u $HOST_UID $CI_USER)
>>
>>  # Build and test
>> -linux32 --32bit i386 su -m -l $CI_USER -c '
>> +linux32 --32bit i386 su -m -l $CI_USER -c "
>>       set -ex
>>       cd /usr/src/git
>> -     ln -s /tmp/travis-cache/.prove t/.prove
>> +     test -n '$cache_dir' && ln -s '$cache_dir/.prove' t/.prove
>>       make --jobs=2
>>       make --quiet test
>> -'
>> +"
>
> This interpolates $cache_dir while generating the snippet. You've stuck
> it in single-quotes, which prevents most quoting problems, but obviously
> it's an issue if the variable itself contains a single-quote. Is there
> a reason not to just export $cache_dir in the environment and access it
> directly from the snippet?

Right, that's my conditioned response to single quotes kicking in :)

We don't even need to export the variable, because Docker has already
done it (that's what 'docker run --env VAR' does).


> Probably not a _big_ deal, since we control the contents of the
> variable, but it just seems like a fragile practice to avoid.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux