diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-10 12:14:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-10 13:24:04 +0000 |
commit | 5cc720aac294428f61212a4e83b2b4b72478de03 (patch) | |
tree | 8c610e489a5c1b9993cfb795161a690f7bf1e280 /bitbake/lib/bb/fetch | |
parent | 8d6800bc8e0bede62d5779a5d6ea879dcf93c88f (diff) | |
download | poky-5cc720aac294428f61212a4e83b2b4b72478de03.tar.gz |
bitbake/fetch: Sync up logger/whitespace improvements
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 67e5addfe0..f7153ebce9 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
@@ -243,17 +243,20 @@ def verify_checksum(u, ud, d): | |||
243 | sha256data = bb.utils.sha256_file(ud.localpath) | 243 | sha256data = bb.utils.sha256_file(ud.localpath) |
244 | 244 | ||
245 | if (ud.md5_expected == None or ud.sha256_expected == None): | 245 | if (ud.md5_expected == None or ud.sha256_expected == None): |
246 | bb.warn("Missing SRC_URI checksum for %s, consider to add\n" \ | 246 | logger.warn('Missing SRC_URI checksum for %s, consider adding to the recipe:\n' |
247 | "SRC_URI[%s] = \"%s\"\nSRC_URI[%s] = \"%s\"" \ | 247 | 'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"', |
248 | % (ud.localpath, ud.md5_name, md5data, ud.sha256_name, sha256data)) | 248 | ud.localpath, ud.md5_name, md5data, |
249 | ud.sha256_name, sha256data) | ||
249 | if bb.data.getVar("BB_STRICT_CHECKSUM", d, True) == "1": | 250 | if bb.data.getVar("BB_STRICT_CHECKSUM", d, True) == "1": |
250 | raise FetchError("No checksum specified for %s." % u) | 251 | raise FetchError("No checksum specified for %s." % u) |
251 | return | 252 | return |
252 | 253 | ||
253 | if (ud.md5_expected != md5data or ud.sha256_expected != sha256data): | 254 | if (ud.md5_expected != md5data or ud.sha256_expected != sha256data): |
254 | bb.error("The checksums for '%s' did not match." % ud.localpath) | 255 | logger.error('The checksums for "%s" did not match.\n' |
255 | bb.error("Expected MD5: '%s' and Got: '%s'" % (ud.md5_expected, md5data)) | 256 | ' MD5: expected "%s", got "%s"\n' |
256 | bb.error("Expected SHA256: '%s' and Got: '%s'" % (ud.sha256_expected, sha256data)) | 257 | ' SHA256: expected "%s", got "%s"\n', |
258 | ud.localpath, ud.md5_expected, md5data, | ||
259 | ud.sha256_expected, sha256data) | ||
257 | raise FetchError("%s checksum mismatch." % u) | 260 | raise FetchError("%s checksum mismatch." % u) |
258 | 261 | ||
259 | def go(d, urls = None): | 262 | def go(d, urls = None): |
@@ -326,7 +329,7 @@ def checkstatus(d, urls = None): | |||
326 | for u in urls: | 329 | for u in urls: |
327 | ud = urldata[u] | 330 | ud = urldata[u] |
328 | m = ud.method | 331 | m = ud.method |
329 | logger.debug(1, "Testing URL %s" % u) | 332 | logger.debug(1, "Testing URL %s", u) |
330 | # First try checking uri, u, from PREMIRRORS | 333 | # First try checking uri, u, from PREMIRRORS |
331 | mirrors = mirror_from_string(bb.data.getVar('PREMIRRORS', d, True)) | 334 | mirrors = mirror_from_string(bb.data.getVar('PREMIRRORS', d, True)) |
332 | ret = try_mirrors(d, u, mirrors, True) | 335 | ret = try_mirrors(d, u, mirrors, True) |
@@ -482,7 +485,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False): | |||
482 | """ | 485 | """ |
483 | fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri)) | 486 | fpath = os.path.join(data.getVar("DL_DIR", d, 1), os.path.basename(uri)) |
484 | if not check and os.access(fpath, os.R_OK) and not force: | 487 | if not check and os.access(fpath, os.R_OK) and not force: |
485 | logger.debug(1, "%s already exists, skipping checkout." % fpath) | 488 | logger.debug(1, "%s already exists, skipping checkout.", fpath) |
486 | return fpath | 489 | return fpath |
487 | 490 | ||
488 | ld = d.createCopy() | 491 | ld = d.createCopy() |
@@ -510,7 +513,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False): | |||
510 | bb.fetch.MD5SumError): | 513 | bb.fetch.MD5SumError): |
511 | import sys | 514 | import sys |
512 | (type, value, traceback) = sys.exc_info() | 515 | (type, value, traceback) = sys.exc_info() |
513 | logger.debug(2, "Mirror fetch failure: %s" % value) | 516 | logger.debug(2, "Mirror fetch failure: %s", value) |
514 | removefile(ud.localpath) | 517 | removefile(ud.localpath) |
515 | continue | 518 | continue |
516 | return None | 519 | return None |
@@ -694,7 +697,7 @@ class Fetch(object): | |||
694 | if not rev: | 697 | if not rev: |
695 | rev = data.getVar("SRCREV_pn-%s_%s" % (pn, ud.parm['name']), d, 1) | 698 | rev = data.getVar("SRCREV_pn-%s_%s" % (pn, ud.parm['name']), d, 1) |
696 | if not rev: | 699 | if not rev: |
697 | rev = data.getVar("SRCREV_%s" % (ud.parm['name']), d, 1) | 700 | rev = data.getVar("SRCREV_%s" % (ud.parm['name']), d, 1) |
698 | if not rev: | 701 | if not rev: |
699 | rev = data.getVar("SRCREV", d, 1) | 702 | rev = data.getVar("SRCREV", d, 1) |
700 | if rev == "INVALID": | 703 | if rev == "INVALID": |