summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
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/lib/bb/fetch2
parent831c6c1d3c23c50f9c55a6bbf8dc6311bca3881b (diff)
downloadpoky-f60d9d6bd4bb7691b62bf1f4b1fbeaa1faa53879.tar.gz
bitbake/fetch2: Move getSRCDate to FetchData class where is more appropriate
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-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):
617 self.localpath = None 617 self.localpath = None
618 self.lockfile = None 618 self.lockfile = None
619 (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d)) 619 (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d))
620 self.date = FetchMethod.getSRCDate(self, d) 620 self.date = self.getSRCDate(d)
621 self.url = url 621 self.url = url
622 if not self.user and "user" in self.parm: 622 if not self.user and "user" in self.parm:
623 self.user = self.parm["user"] 623 self.user = self.parm["user"]
@@ -674,6 +674,21 @@ class FetchData(object):
674 if not self.localpath: 674 if not self.localpath:
675 self.localpath = self.method.localpath(self.url, self, d) 675 self.localpath = self.method.localpath(self.url, self, d)
676 676
677 def getSRCDate(self, d):
678 """
679 Return the SRC Date for the component
680
681 d the bb.data module
682 """
683 if "srcdate" in self.parm:
684 return self.parm['srcdate']
685
686 pn = data.getVar("PN", d, 1)
687
688 if pn:
689 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)
690
691 return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
677 692
678class FetchMethod(object): 693class FetchMethod(object):
679 """Base class for 'fetch'ing data""" 694 """Base class for 'fetch'ing data"""
@@ -823,23 +838,6 @@ class FetchMethod(object):
823 logger.info("URL %s could not be checked for status since no method exists.", url) 838 logger.info("URL %s could not be checked for status since no method exists.", url)
824 return True 839 return True
825 840
826 def getSRCDate(urldata, d):
827 """
828 Return the SRC Date for the component
829
830 d the bb.data module
831 """
832 if "srcdate" in urldata.parm:
833 return urldata.parm['srcdate']
834
835 pn = data.getVar("PN", d, 1)
836
837 if pn:
838 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)
839
840 return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
841 getSRCDate = staticmethod(getSRCDate)
842
843 def localcount_internal_helper(ud, d, name): 841 def localcount_internal_helper(ud, d, name):
844 """ 842 """
845 Return: 843 Return: