* [PATCH 0/1] fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY @ 2012-08-09 8:54 Robert Yang 2012-08-09 8:54 ` [PATCH 1/1] " Robert Yang 2012-08-09 8:58 ` [PATCH 0/1] " Robert Yang 0 siblings, 2 replies; 3+ messages in thread From: Robert Yang @ 2012-08-09 8:54 UTC (permalink / raw) To: openembedded-core; +Cc: Zhenfeng.Zhao The following changes since commit 2dec760b79bb7e2e79c33c5127fa64685bd86a18: foomatic: fix perl path for target (2012-08-08 10:06:00 +0100) are available in the git repository at: git://git.pokylinux.org/poky-contrib robert/autorev http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/autorev Robert Yang (1): fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY bitbake/lib/bb/fetch2/__init__.py | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY 2012-08-09 8:54 [PATCH 0/1] fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY Robert Yang @ 2012-08-09 8:54 ` Robert Yang 2012-08-09 8:58 ` [PATCH 0/1] " Robert Yang 1 sibling, 0 replies; 3+ messages in thread From: Robert Yang @ 2012-08-09 8:54 UTC (permalink / raw) To: openembedded-core; +Cc: Zhenfeng.Zhao The newly added "auto" policy is used for the SRCREV="${AUTOREV}" recipe, the current BB_SRCREV_POLICY are: "clear" (default) and "cache": * When "clear", the "AUTOREV" recipe will not be cached in bb_cache.dat * When "cache", the "AUTOREV" would be cached in bb_cache.dat, but it doesn't try to get the latest revision. The "auto" policy is much like the "cache" except that it will try to get the latest revision. [YOCTO #2920] Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- bitbake/lib/bb/fetch2/__init__.py | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 12ebce2..27b73c0 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -249,8 +249,8 @@ def fetcher_init(d): Calls before this must not hit the cache. """ # When to drop SCM head revisions controlled by user policy - srcrev_policy = d.getVar('BB_SRCREV_POLICY', True) or "clear" - if srcrev_policy == "cache": + srcrev_policy = get_srcrev_policy(d) + if srcrev_policy == "cache" or srcrev_policy == "auto": logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy) elif srcrev_policy == "clear": logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy) @@ -384,9 +384,13 @@ def subprocess_setup(): # SIGPIPE errors are known issues with gzip/bash signal.signal(signal.SIGPIPE, signal.SIG_DFL) +def get_srcrev_policy(d): + return d.getVar('BB_SRCREV_POLICY', True) or "auto" + def get_autorev(d): # only not cache src rev in autorev case - if d.getVar('BB_SRCREV_POLICY', True) != "cache": + srcrev_policy = get_srcrev_policy(d) + if srcrev_policy != "cache" and srcrev_policy != "auto": d.setVar('__BB_DONT_CACHE', '1') return "AUTOINC" @@ -1048,6 +1052,8 @@ class FetchMethod(object): revs = bb.persist_data.persist('BB_URI_HEADREVS', d) key = self.generate_revision_key(url, ud, d, name) + if get_srcrev_policy(d) == "auto": + revs[key] = self._latest_revision(url, ud, d, name) try: return revs[key] except KeyError: -- 1.7.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY 2012-08-09 8:54 [PATCH 0/1] fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY Robert Yang 2012-08-09 8:54 ` [PATCH 1/1] " Robert Yang @ 2012-08-09 8:58 ` Robert Yang 1 sibling, 0 replies; 3+ messages in thread From: Robert Yang @ 2012-08-09 8:58 UTC (permalink / raw) To: openembedded-core Sorry, please ignore this one, it should go to bitbake-devel. // Robert On 08/09/2012 04:54 PM, Robert Yang wrote: > The following changes since commit 2dec760b79bb7e2e79c33c5127fa64685bd86a18: > > foomatic: fix perl path for target (2012-08-08 10:06:00 +0100) > > are available in the git repository at: > git://git.pokylinux.org/poky-contrib robert/autorev > http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/autorev > > Robert Yang (1): > fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY > > bitbake/lib/bb/fetch2/__init__.py | 12 +++++++++--- > 1 files changed, 9 insertions(+), 3 deletions(-) > > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core > > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-09 9:10 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-09 8:54 [PATCH 0/1] fetch2/__init__.py: add an "auto" policy for BB_SRCREV_POLICY Robert Yang 2012-08-09 8:54 ` [PATCH 1/1] " Robert Yang 2012-08-09 8:58 ` [PATCH 0/1] " Robert Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox