From 13602f74210ef012e7c8d534b3ffabe7a402becd Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 29 Apr 2006 10:25:13 +0000 Subject: [PATCH] lib/bb/fetch/cvs.py: lib/bb/fetch/__init__.py: lib/bb/fetch/svn.py: - Move the DL_DIR check into try_mirror since every fetcher will do this. (git fetcher already assumes this check is made) --- lib/bb/fetch/__init__.py | 4 ++++ lib/bb/fetch/cvs.py | 6 +----- lib/bb/fetch/svn.py | 6 +----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index ac698a0d..0515f2a5 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -168,6 +168,10 @@ class Fetch(object): d Is a bb.data instance tarfn is the name of the tarball """ + tarpath = os.path.join(data.getVar("DL_DIR", d, 1), tarfn) + if os.access(tarpath, os.R_OK): + return True + pn = data.getVar('PN', d, True) src_tarball_stash = None if pn: diff --git a/lib/bb/fetch/cvs.py b/lib/bb/fetch/cvs.py index 10ec700d..b2a65de2 100644 --- a/lib/bb/fetch/cvs.py +++ b/lib/bb/fetch/cvs.py @@ -128,13 +128,9 @@ 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): + bb.debug(1, "%s already exists or was mirrored, skipping cvs checkout." % tarfn) continue if date: diff --git a/lib/bb/fetch/svn.py b/lib/bb/fetch/svn.py index 6e3a9277..ee57ea61 100644 --- a/lib/bb/fetch/svn.py +++ b/lib/bb/fetch/svn.py @@ -111,13 +111,9 @@ 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): + bb.debug(1, "%s already exists or was mirrored, skipping svn checkout." % tarfn) continue olddir = os.path.abspath(os.getcwd()) -- 2.20.1