diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2006-01-05 20:14:21 +0000 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2006-01-05 20:14:21 +0000 |
commit | c4e44beed02739556f01a7a1c26b0657d3e699b6 (patch) | |
tree | e5ffc3b5cdc622bdcebbe3c7780706d76ed1b19e /lib/bb/fetch | |
parent | dcf8e5e245911ea22931904ebc76379cd0fa9d5f (diff) | |
download | bitbake-c4e44beed02739556f01a7a1c26b0657d3e699b6.tar.gz |
bitbake/lib/bb/fetch:
Add a getSRCDate static method to the Fetcher Baseclass
to extract the SRCDATE with fallbacks to CVSDATE and DATE
Switch over users of CVSDATE to this new method.
Diffstat (limited to 'lib/bb/fetch')
-rw-r--r-- | lib/bb/fetch/__init__.py | 9 | ||||
-rw-r--r-- | lib/bb/fetch/cvs.py | 4 | ||||
-rw-r--r-- | lib/bb/fetch/svn.py | 4 |
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"] |