RFR: 8048184 : (s) handle mercurial dev build version string
Daniel Fuchs
daniel.fuchs at oracle.com
Tue Jul 8 10:49:07 UTC 2014
Hi Mike,
The issue seems to be that 'expr 0 + 0' writes 0 on stdout
but has an exit status of 1
$ expr 0 + 0
0
$ echo $?
1
$ man expr
EXPR(1) BSD General Commands Manual EXPR(1)
[ ... ]
DIAGNOSTICS
The expr utility exits with one of the following values:
0 the expression is neither an empty string nor 0.
1 the expression is an empty string or 0.
2 the expression is invalid.
[ ... ]
-- daniel
On 7/8/14 12:30 PM, Daniel Fuchs wrote:
> Hi Mike,
>
> sorry for not reacting sooner.
> I applied your patch on my machine, and now get the following:
>
> sh ./get_source.sh
> ./get_source.sh: line 70: [: too many arguments
> ./get_source.sh: line 76: [: `)' expected, found -1
> ./get_source.sh: line 82: [: `)' expected, found -1
>
>
> I have added:
>
> echo hgversion="$hgversion"
> echo hgmajor="$hgmajor"
> echo hgminor="$hgminor"
> echo hgrev="$hgrev"
>
> just before line 70 and I see this:
>
> $ sh ./get_source.sh
> hgversion=3.0.1
> hgmajor=3
> hgminor=0
> -1
> hgrev=
> ./get_source.sh: line 76: [: too many arguments
> ./get_source.sh: line 82: [: `)' expected, found -1
> ./get_source.sh: line 88: [: `)' expected, found -1
>
>
> There is a strange '-1' which gets printed - and it
> seems it comes from $hgminor, whose value is:
>
> hgminor='0
> -1'
>
>
> best regards,
>
> -- daniel
>
>
> On 6/26/14 9:01 PM, Mike Duigou wrote:
>> Hello all;
>>
>> After pushing JDK-8047925 it was discovered that unofficial
>> development builds of Mercurial use a different version string format
>> and get_source.sh needs an enhancement to correctly parse this version
>> string.
>>
>> I have also incorporated some cleanup suggested by Dave Pointon, made
>> the script more defensive in it's handling of numeric values and
>> replaced the use of 'which' with the more reliable 'command -v'
>>
>> jbsbug: https://bugs.openjdk.java.net/browse/JDK-8048184
>> webrev: http://cr.openjdk.java.net/~mduigou/JDK-8048184/0/webrev/
>>
>> Mike
>>
>
More information about the build-dev
mailing list