* [PATCHv2 1/3] oe/recipeutils.py: get_recipe_upstream_info only use sfx and pfx when exits
2015-07-15 0:43 [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements Aníbal Limón
@ 2015-07-15 0:43 ` Aníbal Limón
2015-07-15 0:43 ` [PATCHv2 2/3] oe/recipeutils.py: get_recipe_upstream_info update to get revision Aníbal Limón
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Aníbal Limón @ 2015-07-15 0:43 UTC (permalink / raw)
To: openembedded-core
Don't use pfx and sfx when not exist because cause formatting errors
like 2.9HASH instead of 2.9+gitAUTOINC+HASH.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index bd812cc..ab50686 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -707,14 +707,21 @@ def get_recipe_upstream_version(rd):
if uri_type == 'git':
(pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
- latest_revision = ud.method.latest_revision(ud, rd, ud.names[0])
+ revision = ud.method.latest_revision(ud, rd, ud.names[0])
# if contains revision but not pupver use current pv
- if pupver == '' and latest_revision:
+ if pupver == '' and revision:
pupver = pv
if pupver != '':
- pupver = pfx + pupver + sfx + latest_revision[:10]
+ tmp = pupver
+ pupver = ''
+
+ if pfx:
+ pupver = pfx
+ pupver = pupver + tmp
+ if sfx:
+ pupver = pupver + sfx + revision[:10]
if pupver != '':
ru['version'] = pupver
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCHv2 2/3] oe/recipeutils.py: get_recipe_upstream_info update to get revision
2015-07-15 0:43 [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements Aníbal Limón
2015-07-15 0:43 ` [PATCHv2 1/3] oe/recipeutils.py: get_recipe_upstream_info only use sfx and pfx when exits Aníbal Limón
@ 2015-07-15 0:43 ` Aníbal Limón
2015-07-15 0:43 ` [PATCHv2 3/3] recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv Aníbal Limón
2015-07-20 19:19 ` [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements Aníbal Limón
3 siblings, 0 replies; 5+ messages in thread
From: Aníbal Limón @ 2015-07-15 0:43 UTC (permalink / raw)
To: openembedded-core
Bitbake fetcher latest_versionstring now returns a tuple with (version,
revision) that helps SCM's like git to build current upstream version.
[YOCTO #7605]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index ab50686..f3da864 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -703,28 +703,30 @@ def get_recipe_upstream_version(rd):
else:
ud = bb.fetch2.FetchData(src_uri, rd)
pupver = ud.method.latest_versionstring(ud, rd)
+ (upversion, revision) = pupver
+ # format git version version+gitAUTOINC+HASH
if uri_type == 'git':
(pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
- revision = ud.method.latest_revision(ud, rd, ud.names[0])
+ # if contains revision but not upversion use current pv
+ if upversion == '' and revision:
+ upversion = pv
- # if contains revision but not pupver use current pv
- if pupver == '' and revision:
- pupver = pv
-
- if pupver != '':
- tmp = pupver
- pupver = ''
+ if upversion:
+ tmp = upversion
+ upversion = ''
if pfx:
- pupver = pfx
- pupver = pupver + tmp
+ upversion = pfx + tmp
+ else:
+ upversion = tmp
+
if sfx:
- pupver = pupver + sfx + revision[:10]
+ upversion = upversion + sfx + revision[:10]
- if pupver != '':
- ru['version'] = pupver
+ if upversion:
+ ru['version'] = upversion
ru['type'] = 'A'
ru['datetime'] = datetime.now()
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCHv2 3/3] recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv
2015-07-15 0:43 [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements Aníbal Limón
2015-07-15 0:43 ` [PATCHv2 1/3] oe/recipeutils.py: get_recipe_upstream_info only use sfx and pfx when exits Aníbal Limón
2015-07-15 0:43 ` [PATCHv2 2/3] oe/recipeutils.py: get_recipe_upstream_info update to get revision Aníbal Limón
@ 2015-07-15 0:43 ` Aníbal Limón
2015-07-20 19:19 ` [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements Aníbal Limón
3 siblings, 0 replies; 5+ messages in thread
From: Aníbal Limón @ 2015-07-15 0:43 UTC (permalink / raw)
To: openembedded-core
Some recipes uses v or r prefixes in versions that makes wrong
comparisions over recipes like lz4 r123 > 128.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index f3da864..90dfba2 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -644,6 +644,12 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
pv = m.group('ver')
pfx = m.group('pfx')
sfx = m.group('sfx')
+ else:
+ regex = re.compile("(?P<pfx>(v|r|))(?P<ver>((\d+[\.\-_]*)+))")
+ m = regex.match(pv)
+ if m:
+ pv = m.group('ver')
+ pfx = m.group('pfx')
return (pv, pfx, sfx)
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements
2015-07-15 0:43 [PATCHv2 0/3] oe/recipeutils.py: get_recipe_upstream_info improvements Aníbal Limón
` (2 preceding siblings ...)
2015-07-15 0:43 ` [PATCHv2 3/3] recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv Aníbal Limón
@ 2015-07-20 19:19 ` Aníbal Limón
3 siblings, 0 replies; 5+ messages in thread
From: Aníbal Limón @ 2015-07-20 19:19 UTC (permalink / raw)
To: openembedded-core
ping...
On 14/07/15 19:43, Aníbal Limón wrote:
> Sending v2 i forget to include first patch.
>
> This patch set uses the new latest_versionstring method that returns the
> current revision of a version in SCM's this DEPENDS on,
>
> http://lists.openembedded.org/pipermail/bitbake-devel/2015-July/006034.html
>
> Aníbal Limón (3):
> oe/recipeutils.py: get_recipe_upstream_info only use sfx and pfx when
> exits
> oe/recipeutils.py: get_recipe_upstream_info update to get revision
> recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv
>
> meta/lib/oe/recipeutils.py | 31 +++++++++++++++++++++++--------
> 1 file changed, 23 insertions(+), 8 deletions(-)
>
^ permalink raw reply [flat|nested] 5+ messages in thread