summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-09-08 15:04:17 +0100
committerJoshua Lock <josh@linux.intel.com>2010-09-08 15:09:07 +0100
commit3341e47b52f9038894d6600b8702a331c3806af5 (patch)
treec5a09ffb771fd2f2a911f11de11b0f89c09685d6 /bitbake
parent3010c96a3f1c1e8de07c508dcf7b1d507569508f (diff)
downloadopenembedded-core-3341e47b52f9038894d6600b8702a331c3806af5.tar.gz
bitbake/fetch: fix by moving try_premirror() to the right place
The previous commit didn't define the method as part of the Fetch object Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 2b0b288df0..a27b40f6ac 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -222,18 +222,6 @@ def init(urls, d, setup = True):
urldata_cache[fn] = urldata
return urldata
-def try_premirror(u, ud, d):
- """
- Should we try premirrors for this url, u?
- We should if forcefetch is set or the localfile and md5 don't exist
- """
- if ud.method.forcefetch(u, ud, d):
- return True
- elif os.path.exists(ud.md5) and os.path.exists(ud.localfile):
- return False
- else:
- return True
-
def go(d, urls = None):
"""
Fetch all urls
@@ -590,6 +578,17 @@ class Fetch(object):
"""
raise NoMethodError("Missing implementation for url")
+ def try_premirror(self, url, urldata, d):
+ """
+ Should premirrors be used?
+ """
+ if urldata.method.forcefetch(url, urldata, d):
+ return True
+ elif os.path.exists(urldata.md5) and os.path.exists(urldata.localfile):
+ return False
+ else:
+ return True
+
def checkstatus(self, url, urldata, d):
"""
Check the status of a URL