diff options
author | Joshua Lock <josh@linux.intel.com> | 2010-09-08 15:04:17 +0100 |
---|---|---|
committer | Joshua Lock <josh@linux.intel.com> | 2010-09-08 15:09:07 +0100 |
commit | 3341e47b52f9038894d6600b8702a331c3806af5 (patch) | |
tree | c5a09ffb771fd2f2a911f11de11b0f89c09685d6 | |
parent | 3010c96a3f1c1e8de07c508dcf7b1d507569508f (diff) | |
download | poky-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>
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 23 |
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): | |||
222 | urldata_cache[fn] = urldata | 222 | urldata_cache[fn] = urldata |
223 | return urldata | 223 | return urldata |
224 | 224 | ||
225 | def try_premirror(u, ud, d): | ||
226 | """ | ||
227 | Should we try premirrors for this url, u? | ||
228 | We should if forcefetch is set or the localfile and md5 don't exist | ||
229 | """ | ||
230 | if ud.method.forcefetch(u, ud, d): | ||
231 | return True | ||
232 | elif os.path.exists(ud.md5) and os.path.exists(ud.localfile): | ||
233 | return False | ||
234 | else: | ||
235 | return True | ||
236 | |||
237 | def go(d, urls = None): | 225 | def go(d, urls = None): |
238 | """ | 226 | """ |
239 | Fetch all urls | 227 | Fetch all urls |
@@ -590,6 +578,17 @@ class Fetch(object): | |||
590 | """ | 578 | """ |
591 | raise NoMethodError("Missing implementation for url") | 579 | raise NoMethodError("Missing implementation for url") |
592 | 580 | ||
581 | def try_premirror(self, url, urldata, d): | ||
582 | """ | ||
583 | Should premirrors be used? | ||
584 | """ | ||
585 | if urldata.method.forcefetch(url, urldata, d): | ||
586 | return True | ||
587 | elif os.path.exists(urldata.md5) and os.path.exists(urldata.localfile): | ||
588 | return False | ||
589 | else: | ||
590 | return True | ||
591 | |||
593 | def checkstatus(self, url, urldata, d): | 592 | def checkstatus(self, url, urldata, d): |
594 | """ | 593 | """ |
595 | Check the status of a URL | 594 | Check the status of a URL |