diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 22 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch/cvs.py | 8 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch/svk.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/fetch/svn.py | 11 |
4 files changed, 28 insertions, 17 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index ac698a0d1c..a2defd25a5 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py @@ -185,6 +185,28 @@ class Fetch(object): return False try_mirror = staticmethod(try_mirror) + def check_for_tarball(d, tarfn, dldir, date): + """ + Check for a local copy then check the tarball stash. + Both checks are skipped if date == 'now'. + + d Is a bb.data instance + tarfn is the name of the tarball + date is the SRCDATE + """ + if "now" != date: + dl = os.path.join(dldir, tarfn) + if os.access(dl, os.R_OK): + bb.debug(1, "%s already exists, skipping checkout." % tarfn) + return True + + # try to use the tarball stash + if Fetch.try_mirror(d, tarfn): + return True + return False + check_for_tarball = staticmethod(check_for_tarball) + + import cvs import git import local diff --git a/bitbake/lib/bb/fetch/cvs.py b/bitbake/lib/bb/fetch/cvs.py index 10ec700dc9..0b2477560a 100644 --- a/bitbake/lib/bb/fetch/cvs.py +++ b/bitbake/lib/bb/fetch/cvs.py @@ -128,13 +128,7 @@ class Cvs(Fetch): data.setVar('TARFILES', dlfile, localdata) data.setVar('TARFN', tarfn, localdata) - dl = os.path.join(dldir, tarfn) - if os.access(dl, os.R_OK): - bb.debug(1, "%s already exists, skipping cvs checkout." % tarfn) - continue - - # try to use the tarball stash - if Fetch.try_mirror(d, tarfn): + if Fetch.check_for_tarball(d, tarfn, dldir, date): continue if date: diff --git a/bitbake/lib/bb/fetch/svk.py b/bitbake/lib/bb/fetch/svk.py index c0819da3dc..19103213cd 100644 --- a/bitbake/lib/bb/fetch/svk.py +++ b/bitbake/lib/bb/fetch/svk.py @@ -101,9 +101,7 @@ class Svk(Fetch): data.setVar('TARFILES', dlfile, localdata) data.setVar('TARFN', tarfn, localdata) - dl = os.path.join(dldir, tarfn) - if os.access(dl, os.R_OK): - bb.debug(1, "%s already exists, skipping svk checkout." % tarfn) + if Fetch.check_for_tarball(d, tarfn, dldir, date): continue olddir = os.path.abspath(os.getcwd()) diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py index 6e3a9277ab..d1a959371b 100644 --- a/bitbake/lib/bb/fetch/svn.py +++ b/bitbake/lib/bb/fetch/svn.py @@ -111,13 +111,7 @@ class Svn(Fetch): data.setVar('TARFILES', dlfile, localdata) data.setVar('TARFN', tarfn, localdata) - dl = os.path.join(dldir, tarfn) - if os.access(dl, os.R_OK): - bb.debug(1, "%s already exists, skipping svn checkout." % tarfn) - continue - - # try to use the tarball stash - if Fetch.try_mirror(d, tarfn): + if Fetch.check_for_tarball(d, tarfn, dldir, date): continue olddir = os.path.abspath(os.getcwd()) @@ -133,6 +127,9 @@ class Svn(Fetch): if revision: svncmd = "svn co -r %s %s://%s/%s" % (revision, proto, svnroot, module) + elif date == "now": + svncmd = "svn co %s://%s/%s" % (proto, svnroot, module) + if svn_rsh: svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, svncmd) |