${VERSION%.*} in DETAILS - Was - Re: [Lunar-commits] <moonbase> Twisted: Version bumped to 11.0.0 + DETAILS fixes

Auke Kok auke at foo-projects.org
Thu Jun 16 06:24:34 CEST 2011


On 06/15/2011 04:15 AM, Duncan Gibson wrote:
>> It's quite simple really. ${parameter%word} would remove first match of
>> 'word' from the end of the parameter (string). ${VERSION%.*} means
>> remove first occurence of . read from right to left and everything after
>> it using '*'. If VERSION is 11.2.3 that would give you '11.2'. If you
>> want '11' instead all you need to do is to add another % like: ${VERSION
>> %%.*}, this means longest match possible. First match would remove .3,
>> the second match .2 (read from right to left ie suffix) there third will
>> not match since there's no . in front of 11.
>
> OK, that makes the use of ${VERSION%.*} itself clearer.
>
> I assume that "lin -w" subsitutes its argument for $VERSION when it
> tries to download, and that's why $MAJOR gives problems.

correct.

and, I agree with the removal of $MAJOR here. while lin -w is a hack, 
using weird constructs to finick with version numbers is worse. 
unfortunately not everyone reads the ABS guide every week ;)

Auke


More information about the Lunar-dev mailing list