summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/fetch/__init__.py9
-rw-r--r--lib/bb/fetch/cvs.py4
-rw-r--r--lib/bb/fetch/svn.py4
3 files changed, 13 insertions, 4 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py
index d68a1f166..da5b10c4b 100644
--- a/lib/bb/fetch/__init__.py
+++ b/lib/bb/fetch/__init__.py
@@ -149,6 +149,15 @@ class Fetch(object):
"""Fetch urls"""
raise NoMethodError("Missing implementation for url")
+ def getSRCDate(d):
+ """
+ Return the SRC Date for the component
+
+ d the bb.data module
+ """
+ return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1 )
+ getSRCDate = staticmethod(getSRCDate)
+
#if __name__ == "__main__":
import bk
diff --git a/lib/bb/fetch/cvs.py b/lib/bb/fetch/cvs.py
index 7935744e7..461a2f50f 100644
--- a/lib/bb/fetch/cvs.py
+++ b/lib/bb/fetch/cvs.py
@@ -60,7 +60,7 @@ class Cvs(Fetch):
date = parm['date']
else:
if not tag:
- date = data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
+ date = Fetch.getSRCDate(d)
else:
date = ""
@@ -105,7 +105,7 @@ class Cvs(Fetch):
date = parm['date']
else:
if not tag:
- date = data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
+ date = Fetch.getSRCDate(d)
else:
date = ""
diff --git a/lib/bb/fetch/svn.py b/lib/bb/fetch/svn.py
index 6c1f95d9a..ac5eebf5c 100644
--- a/lib/bb/fetch/svn.py
+++ b/lib/bb/fetch/svn.py
@@ -57,7 +57,7 @@ class Svn(Fetch):
else:
revision = ""
- date = data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
+ date = Fetch.getSRCDate(d)
return os.path.join(data.getVar("DL_DIR", d, 1),data.expand('%s_%s_%s_%s_%s.tar.gz' % ( module.replace('/', '.'), host, path.replace('/', '.'), revision, date), d))
localpath = staticmethod(localpath)
@@ -96,7 +96,7 @@ class Svn(Fetch):
else:
revision = ""
- date = data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
+ date = Fetch.getSRCDate(d)
if "method" in parm:
method = parm["method"]