Fernando wrote:
> Em 15-05-2013 20:06, Bruce Dubbs escreveu:
>> Michael E. Maher wrote:
>>
>>> The mail from Matias really says it all, it's the extra `(POSIX regular
>>> expressions)' which is screwing up the integer comparison `if test "..."
>>> -ge 429; then'.
>>>
>>> This seems like a bug in either:
>>>      less -V giving too much information for xz
>>>      - or -
>>>      xzless assuming that less -V is a certain way
>>>
>>> For a quick (untested) hack, you could remove the check or change the
>>> statement to:
>>>
>>> if test "$(less -V | { read ver && echo ${ver#less }; } | awk '{print
>>> $1}')" -ge 429; then
>>
>> System 1
>>
>> $ less -V
>> less 444
>> ...
>>
>> System 2
>>
>> $ less -V
>> less 451 (POSIX regular expressions)
>>
>> The error is in xz assuming that the version format doesn't change.
>>
>> It should be something like:
>>
>> if ( test "$(less -V | head -n1 | cut -d' ' -f2)" -ge 429; then
>> ...
>>
>> That's shorter, more robust, and has more clarity.
>>
>>     -- Bruce
>>
>
> Thank you, Bruce,
>
> I have got an error with your suggestion. A typo, I think. Corrected
> adding a ")" after "429":
>
> if ( test "$(less -V | head -n1 | cut -d' ' -f2)" -ge 429); then

LOL, yes.  The parentheses do need to balance.

   -- Bruce

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to