summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-08-27 14:04:33 +0100
committerJoshua Lock <josh@linux.intel.com>2010-09-01 11:14:23 +0100
commitb54e95fd069217a192d9bb8a3c261e33600e2538 (patch)
tree7dade2dfbfeae068ebbfd1f092fcee1f2e844938 /bitbake
parent94f29466797b98404eaa77e420fe648b4832f8eb (diff)
downloadpoky-b54e95fd069217a192d9bb8a3c261e33600e2538.tar.gz
bitbake/fetch: Respect forcefetch even when pulling from a mirror
When pulling from a premirror we would prefer a local tarball even when the caller had specified the forcefetch parameter. Add an extra parameter 'force' to try_mirrors, defaulting to False. If set the mirrors will be tested even if the file exists locally. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 47a44708be..ab097dda53 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -258,7 +258,7 @@ def go(d, urls = None):
258 258
259 # First try fetching uri, u, from PREMIRRORS 259 # First try fetching uri, u, from PREMIRRORS
260 mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ] 260 mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ]
261 localpath = try_mirrors(d, u, mirrors) 261 localpath = try_mirrors(d, u, mirrors, False, m.forcefetch(u, ud, d))
262 if not localpath: 262 if not localpath:
263 # Next try fetching from the original uri, u 263 # Next try fetching from the original uri, u
264 try: 264 try:
@@ -430,7 +430,7 @@ def runfetchcmd(cmd, d, quiet = False):
430 430
431 return output 431 return output
432 432
433def try_mirrors(d, uri, mirrors, check = False): 433def try_mirrors(d, uri, mirrors, check = False, force = False):
434 """ 434 """
435 Try to use a mirrored version of the sources. 435 Try to use a mirrored version of the sources.
436 This method will be automatically called before the fetchers go. 436 This method will be automatically called before the fetchers go.
@@ -440,7 +440,7 @@ def try_mirrors(d, uri, mirrors, check = False):
440 mirrors is the list of mirrors we're going to try 440 mirrors is the list of mirrors we're going to try
441 """ 441 """
442 fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri)) 442 fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri))
443 if not check and os.access(fpath, os.R_OK): 443 if not check and os.access(fpath, os.R_OK) and not force:
444 bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists, skipping checkout." % fpath) 444 bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists, skipping checkout." % fpath)
445 return fpath 445 return fpath
446 446