From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: SRCPV migration
Date: Tue, 17 Nov 2009 11:57:15 +0100 [thread overview]
Message-ID: <20091117105715.GH23383@jama> (raw)
In-Reply-To: <1258452062.8810.5.camel@dax.rpnet.com>
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
Updated patch, thanks RP!
--
uin:136542059 jid:Martin.Jansa@gmail.com
Jansa Martin sip:jamasip@voip.wengo.fr
JaMa
[-- Attachment #2: 0001-Optional-LOCALCOUNT-for-recipe.patch --]
[-- Type: text/plain, Size: 2609 bytes --]
From 55c8f06a1382dfb11214b6e12ac47b06fce412a4 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 17 Nov 2009 08:24:52 +0100
Subject: [PATCH] Optional LOCALCOUNT for recipe
* Instead of autoincrement from persistent cache when srcrev is changed.
* Should be used by distributions with multiple builders, where consistent
PV is needed.
* Can be used instead of PR bump in PVs like this "0.0+${PR}+gitr${SRCPV}"
* BB_LOCALCOUNT_OVERRIDE to enable setting LOCALCOUNT for recipe
* This way LOCALCOUNTs can be specified directly in recipes instead of
separated distro config (as not all want to use them). And will be
used only when BB_LOCALCOUNT_OVERRIDE set in distro config.
---
lib/bb/fetch/__init__.py | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py
index 8c0d7ea..9508908 100644
--- a/lib/bb/fetch/__init__.py
+++ b/lib/bb/fetch/__init__.py
@@ -448,6 +448,23 @@ class Fetch(object):
srcrev_internal_helper = staticmethod(srcrev_internal_helper)
+ def localcount_internal_helper(ud, d):
+ """
+ Return:
+ a) a locked localcount if specified
+ b) None otherwise
+ """
+
+ localcount= None
+ if 'name' in ud.parm:
+ pn = data.getVar("PN", d, 1)
+ localcount = data.getVar("LOCALCOUNT_" + ud.parm['name'], d, 1)
+ if not localcount:
+ localcount = data.getVar("LOCALCOUNT", d, 1)
+ return localcount
+
+ localcount_internal_helper = staticmethod(localcount_internal_helper)
+
def try_mirror(d, tarfn):
"""
Try to use a mirrored version of the sources. We do this
@@ -550,13 +567,20 @@ class Fetch(object):
latest_rev = self._build_revision(url, ud, d)
last_rev = pd.getValue("BB_URI_LOCALCOUNT", key + "_rev")
- count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count")
+ uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
+ count = None
+ if uselocalcount:
+ count = Fetch.localcount_internal_helper(ud, d)
+ if count is None:
+ count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count")
if last_rev == latest_rev:
return str(count + "+" + latest_rev)
if count is None:
count = "0"
+ elif uselocalcount:
+ count = str(count)
else:
count = str(int(count) + 1)
--
1.6.5.2
next prev parent reply other threads:[~2009-11-17 10:58 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-15 16:36 SRCPV migration Martin Jansa
2009-11-15 21:22 ` Martin Jansa
2009-11-16 8:38 ` Koen Kooi
2009-11-16 9:39 ` Richard Purdie
2009-11-16 10:37 ` Koen Kooi
2009-11-16 10:49 ` Richard Purdie
2009-11-16 10:59 ` Koen Kooi
2009-11-16 11:39 ` Richard Purdie
2009-11-16 12:10 ` Koen Kooi
2009-11-16 12:37 ` Richard Purdie
2009-11-16 13:15 ` Koen Kooi
2009-11-16 13:43 ` Martin Jansa
2009-11-16 13:55 ` Richard Purdie
2009-11-17 8:55 ` Martin Jansa
2009-11-17 9:08 ` Phil Blundell
2009-11-17 10:01 ` Richard Purdie
2009-11-17 10:57 ` Martin Jansa [this message]
2009-11-20 10:20 ` Martin Jansa
2009-11-17 10:18 ` mok
2009-11-17 15:12 ` Martin Jansa
2009-11-17 16:23 ` Martin Jansa
2009-11-17 16:53 ` Martin Jansa
2009-11-17 15:49 ` Henning Heinold
2009-11-17 9:42 ` Martin Jansa
2009-11-19 16:02 ` Koen Kooi
2009-11-19 16:11 ` Martin Jansa
2009-11-19 16:34 ` Martin Jansa
2009-11-19 17:34 ` Koen Kooi
2009-11-16 11:51 ` Martin Jansa
2009-11-16 12:19 ` Koen Kooi
2009-11-16 12:39 ` Martin Jansa
2009-11-16 10:42 ` Holger Hans Peter Freyther
2009-11-22 19:05 ` SRCPV migration - How SRCPV works! Martin Jansa
2009-11-23 8:07 ` Koen Kooi
2009-11-23 8:52 ` Martin Jansa
2009-11-23 11:12 ` Koen Kooi
2009-11-23 11:42 ` Martin Jansa
2009-11-23 12:00 ` Richard Purdie
2009-11-23 12:15 ` Richard Purdie
2009-11-23 12:29 ` Philip Balister
2009-11-23 13:24 ` Koen Kooi
2009-11-23 13:31 ` Koen Kooi
2009-11-23 13:52 ` Otavio Salvador
2009-11-23 14:58 ` Koen Kooi
2009-11-23 15:09 ` Martin Jansa
2009-11-23 14:29 ` Richard Purdie
2009-11-23 15:00 ` Koen Kooi
2009-11-23 15:12 ` Martin Jansa
2009-11-23 15:52 ` Koen Kooi
2009-11-23 16:07 ` Martin Jansa
2009-11-23 15:05 ` Philip Balister
2009-11-23 15:47 ` Chris Conroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091117105715.GH23383@jama \
--to=martin.jansa@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.