From ce800d3aea333919302a490838906983c18fe54d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 12 Aug 2007 23:06:49 +0000 Subject: bitbake: Sync with upstream 1.8 branch for fixes git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2484 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- bitbake/lib/bb/fetch/__init__.py | 17 +++++++++++++++-- bitbake/lib/bb/fetch/local.py | 4 +++- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/fetch') diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index f739245bd1..229b28c19d 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/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): """ diff --git a/bitbake/lib/bb/fetch/local.py b/bitbake/lib/bb/fetch/local.py index 9be8f1ce4b..5e480a208e 100644 --- a/bitbake/lib/bb/fetch/local.py +++ b/bitbake/lib/bb/fetch/local.py @@ -38,9 +38,11 @@ class Local(Fetch): return urldata.type in ['file','patch'] def localpath(self, url, urldata, d): - """Return the local filename of a given url assuming a successful fetch. + """ + Return the local filename of a given url assuming a successful fetch. """ path = url.split("://")[1] + path = path.split(";")[0] newpath = path if path[0] != "/": filespath = data.getVar('FILESPATH', d, 1) -- cgit v1.2.3