summaryrefslogtreecommitdiff
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-04 11:02:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 09:06:36 +0000
commitf60d9d6bd4bb7691b62bf1f4b1fbeaa1faa53879 (patch)
treec1e68a657e8455cd99caffdf37843784057065ae /bitbake
parent831c6c1d3c23c50f9c55a6bbf8dc6311bca3881b (diff)
downloadopenembedded-core-f60d9d6bd4bb7691b62bf1f4b1fbeaa1faa53879.tar.gz
openembedded-core-f60d9d6bd4bb7691b62bf1f4b1fbeaa1faa53879.tar.bz2
openembedded-core-f60d9d6bd4bb7691b62bf1f4b1fbeaa1faa53879.zip
bitbake/fetch2: Move getSRCDate to FetchData class where is more appropriate
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 03a80d9891..5cd7061cf4 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -617,7 +617,7 @@ class FetchData(object):
self.localpath = None
self.lockfile = None
(self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d))
- self.date = FetchMethod.getSRCDate(self, d)
+ self.date = self.getSRCDate(d)
self.url = url
if not self.user and "user" in self.parm:
self.user = self.parm["user"]
@@ -674,6 +674,21 @@ class FetchData(object):
if not self.localpath:
self.localpath = self.method.localpath(self.url, self, d)
+ def getSRCDate(self, d):
+ """
+ Return the SRC Date for the component
+
+ d the bb.data module
+ """
+ if "srcdate" in self.parm:
+ return self.parm['srcdate']
+
+ pn = data.getVar("PN", d, 1)
+
+ if pn:
+ return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
+
+ return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
class FetchMethod(object):
"""Base class for 'fetch'ing data"""
@@ -823,23 +838,6 @@ class FetchMethod(object):
logger.info("URL %s could not be checked for status since no method exists.", url)
return True
- def getSRCDate(urldata, d):
- """
- Return the SRC Date for the component
-
- d the bb.data module
- """
- if "srcdate" in urldata.parm:
- return urldata.parm['srcdate']
-
- pn = data.getVar("PN", d, 1)
-
- if pn:
- return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
-
- return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
- getSRCDate = staticmethod(getSRCDate)
-
def localcount_internal_helper(ud, d, name):
"""
Return: