[OE-core] [PATCH 25/26] distrodata.bbclass: do not use get_recipe_pv_without_srcpv() before comparing versions in checkpkg

Aníbal Limón anibal.limon at linux.intel.com
Fri Jul 31 15:31:23 UTC 2015



On 31/07/15 10:09, Alexander Kanavin wrote:
> On 07/31/2015 05:54 PM, Aníbal Limón wrote:
>> I added get_recipe_pv_without_srcpv for compare git versions because
>> vercmp_string
>> don't take into account git versioning (git, gitAUTOINC) causing wrong
>> comparisons.
>>
>> We need to review if removal don't affect the current upstream 
>> detection.
>
> These are the regex strings that get_recipe_pv_without_srcpv() is using:
>
> for git sources:
> git_regex = 
> re.compile("(?P<pfx>(v|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
>
> for everything else:
> regex = re.compile("(?P<pfx>(v|r|))(?P<ver>((\d+[\.\-_]*)+))")
>
> Both regular expressions are too restrictive in allowing only numeric 
> characters in the <ver> component. If you try to match, say 3.1rc1 and 
> 3.1rc2, they will be both stripped of the '.rcN part, <ver> will be 
> set to 3, and vercmp_string will of course say they match!

In this case we need to add rcN into the regex because if you cmp 
something like,

 >>> import bb
 >>> bb.utils.vercmp_string('3.0+gitX', '2.9+gitX')

It returns 1 that means 2.9+gitX is greater than 3.0+gitX.

     alimon

>
> Alex




More information about the Openembedded-core mailing list