[PATCH 1 of 6 STABLE] dockerdeb: elimate 'cd' in export command

Sean Farley sean at farley.io
Tue Apr 19 13:01:33 EDT 2016


Yuya Nishihara <yuya at tcha.org> writes:

> On Mon, 18 Apr 2016 10:52:08 -0700, Sean Farley wrote:
>> # HG changeset patch
>> # User Sean Farley <sean at farley.io>
>> # Date 1460914600 25200
>> #      Sun Apr 17 10:36:40 2016 -0700
>> # Branch stable
>> # Node ID db33d0e7476c79ac0bc8048992ec6d24d6062c87
>> # Parent  97811ff7964710d32cae951df1da8019b46151a2
>> # EXP-Topic ppa
>> dockerdeb: elimate 'cd' in export command
>> 
>> This had the unfortunate side effect of causing the environment to have a
>> newline due to the fact that some 'cd' outputs the result of the directory
>> change.
>> 
>> diff --git a/contrib/dockerdeb b/contrib/dockerdeb
>> --- a/contrib/dockerdeb
>> +++ b/contrib/dockerdeb
>> @@ -2,11 +2,11 @@
>>  
>>  . $(dirname $0)/dockerlib.sh
>>  . $(dirname $0)/packagelib.sh
>>  
>>  BUILDDIR=$(dirname $0)
>> -export ROOTDIR=$(cd $BUILDDIR/..; pwd)
>> +export ROOTDIR=$(dirname $(readlink -f $BUILDDIR))
>
> IIRC, "readlink -f" is GNU extension. If we have to care for docker on OS X,
> we can't use it. If "cd" is the source of the problem,
> $(cd $BUILDDIR/.. > /dev/null; pwd) might work.

Argh, you're right. I was thinking this would be run *inside* docker
but, of course, that's not correct. Ok, I'll go with the redirection
method and resend.


More information about the Mercurial-devel mailing list