diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-11 23:30:39 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-11 23:30:39 +0000 |
commit | 1db515ce4dfcb86f6502892ad8c5f7ccce5690f6 (patch) | |
tree | cfeaeb020de91ad3124aa88b25baa8d6c3ed9e58 | |
parent | b4c30ae359ee34dd8db5402bf89852ea3e5f3ad6 (diff) | |
download | bitbake-1db515ce4dfcb86f6502892ad8c5f7ccce5690f6.tar.gz |
fetch/__init__.py: Add SRCREV_FORMAT support
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | lib/bb/fetch/__init__.py | 17 |
2 files changed, 16 insertions, 2 deletions
@@ -14,6 +14,7 @@ Changes in Bitbake 1.8.x: already run before starting the build rather than during it - Add profiling option (-P) - Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache + - Add SRCREV_FORMAT support Changes in Bitbake 1.8.6: - Correctly redirect stdin when forking diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index f739245bd..229b28c19 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -182,8 +182,21 @@ def get_srcrev(d): if len(scms) == 1: return urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d) - bb.msg.error(bb.msg.domain.Fetcher, "Sorry, support for SRCREV_FORMAT still needs to be written") - raise ParameterError + # + # Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT + # + format = bb.data.getVar('SRCREV_FORMAT', d, 1) + if not format: + bb.msg.error(bb.msg.domain.Fetcher, "The SRCREV_FORMAT variable must be set when multiple SCMs are used.") + raise ParameterError + + for scm in scms: + if 'name' in urldata[scm].parm: + name = urldata[scm].parm["name"] + rev = urldata[scm].method.sortable_revision(scm, urldata[scm], d) + format = format.replace(name, rev) + + return format def localpath(url, d, cache = True): """ |