summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-09 14:01:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-11 10:34:30 +0100
commit654eadfa30624c62018665da618287b6cb5c7e3c (patch)
treeddca0b2edbf92abfd7e7f6e9cd9c3499d704ea45 /bitbake/lib/bb/fetch2
parent5052bf92e40d8e0764a11e897f06d3d9c7c065e9 (diff)
downloadpoky-654eadfa30624c62018665da618287b6cb5c7e3c.tar.gz
bitbake: bitbake: Update logger.warn() -> logger.warning()
python deprecated logger.warn() in favour of logger.warning(). This is only used in bitbake code so we may as well just translate everything to avoid warnings under python 3. Its safe for python 2.7. (Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py36
-rw-r--r--bitbake/lib/bb/fetch2/npm.py4
2 files changed, 20 insertions, 20 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 6ef0c6fe7a..600e2161fe 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -586,12 +586,12 @@ def verify_checksum(ud, d, precomputed={}):
586 raise NoChecksumError('Missing SRC_URI checksum', ud.url) 586 raise NoChecksumError('Missing SRC_URI checksum', ud.url)
587 587
588 # Log missing sums so user can more easily add them 588 # Log missing sums so user can more easily add them
589 logger.warn('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n' 589 logger.warning('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
590 'SRC_URI[%s] = "%s"', 590 'SRC_URI[%s] = "%s"',
591 ud.localpath, ud.md5_name, md5data) 591 ud.localpath, ud.md5_name, md5data)
592 logger.warn('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n' 592 logger.warning('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n'
593 'SRC_URI[%s] = "%s"', 593 'SRC_URI[%s] = "%s"',
594 ud.localpath, ud.sha256_name, sha256data) 594 ud.localpath, ud.sha256_name, sha256data)
595 595
596 # We want to alert the user if a checksum is defined in the recipe but 596 # We want to alert the user if a checksum is defined in the recipe but
597 # it does not match. 597 # it does not match.
@@ -659,9 +659,9 @@ def verify_donestamp(ud, d, origud=None):
659 # files to those containing the checksums. 659 # files to those containing the checksums.
660 if not isinstance(e, EOFError): 660 if not isinstance(e, EOFError):
661 # Ignore errors, they aren't fatal 661 # Ignore errors, they aren't fatal
662 logger.warn("Couldn't load checksums from donestamp %s: %s " 662 logger.warning("Couldn't load checksums from donestamp %s: %s "
663 "(msg: %s)" % (ud.donestamp, type(e).__name__, 663 "(msg: %s)" % (ud.donestamp, type(e).__name__,
664 str(e))) 664 str(e)))
665 665
666 try: 666 try:
667 checksums = verify_checksum(ud, d, precomputed_checksums) 667 checksums = verify_checksum(ud, d, precomputed_checksums)
@@ -675,8 +675,8 @@ def verify_donestamp(ud, d, origud=None):
675 except ChecksumError as e: 675 except ChecksumError as e:
676 # Checksums failed to verify, trigger re-download and remove the 676 # Checksums failed to verify, trigger re-download and remove the
677 # incorrect stamp file. 677 # incorrect stamp file.
678 logger.warn("Checksum mismatch for local file %s\n" 678 logger.warning("Checksum mismatch for local file %s\n"
679 "Cleaning and trying again." % ud.localpath) 679 "Cleaning and trying again." % ud.localpath)
680 if os.path.exists(ud.localpath): 680 if os.path.exists(ud.localpath):
681 rename_bad_checksum(ud, e.checksum) 681 rename_bad_checksum(ud, e.checksum)
682 bb.utils.remove(ud.donestamp) 682 bb.utils.remove(ud.donestamp)
@@ -708,8 +708,8 @@ def update_stamp(ud, d):
708 except ChecksumError as e: 708 except ChecksumError as e:
709 # Checksums failed to verify, trigger re-download and remove the 709 # Checksums failed to verify, trigger re-download and remove the
710 # incorrect stamp file. 710 # incorrect stamp file.
711 logger.warn("Checksum mismatch for local file %s\n" 711 logger.warning("Checksum mismatch for local file %s\n"
712 "Cleaning and trying again." % ud.localpath) 712 "Cleaning and trying again." % ud.localpath)
713 if os.path.exists(ud.localpath): 713 if os.path.exists(ud.localpath):
714 rename_bad_checksum(ud, e.checksum) 714 rename_bad_checksum(ud, e.checksum)
715 bb.utils.remove(ud.donestamp) 715 bb.utils.remove(ud.donestamp)
@@ -984,8 +984,8 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
984 984
985 except bb.fetch2.BBFetchException as e: 985 except bb.fetch2.BBFetchException as e:
986 if isinstance(e, ChecksumError): 986 if isinstance(e, ChecksumError):
987 logger.warn("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url)) 987 logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
988 logger.warn(str(e)) 988 logger.warning(str(e))
989 if os.path.exists(ud.localpath): 989 if os.path.exists(ud.localpath):
990 rename_bad_checksum(ud, e.checksum) 990 rename_bad_checksum(ud, e.checksum)
991 elif isinstance(e, NoChecksumError): 991 elif isinstance(e, NoChecksumError):
@@ -1200,7 +1200,7 @@ class FetchData(object):
1200 raise NonLocalMethod() 1200 raise NonLocalMethod()
1201 1201
1202 if self.parm.get("proto", None) and "protocol" not in self.parm: 1202 if self.parm.get("proto", None) and "protocol" not in self.parm:
1203 logger.warn('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN', True)) 1203 logger.warning('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN', True))
1204 self.parm["protocol"] = self.parm.get("proto", None) 1204 self.parm["protocol"] = self.parm.get("proto", None)
1205 1205
1206 if hasattr(self.method, "urldata_init"): 1206 if hasattr(self.method, "urldata_init"):
@@ -1596,14 +1596,14 @@ class Fetch(object):
1596 1596
1597 except BBFetchException as e: 1597 except BBFetchException as e:
1598 if isinstance(e, ChecksumError): 1598 if isinstance(e, ChecksumError):
1599 logger.warn("Checksum failure encountered with download of %s - will attempt other sources if available" % u) 1599 logger.warning("Checksum failure encountered with download of %s - will attempt other sources if available" % u)
1600 logger.debug(1, str(e)) 1600 logger.debug(1, str(e))
1601 if os.path.exists(ud.localpath): 1601 if os.path.exists(ud.localpath):
1602 rename_bad_checksum(ud, e.checksum) 1602 rename_bad_checksum(ud, e.checksum)
1603 elif isinstance(e, NoChecksumError): 1603 elif isinstance(e, NoChecksumError):
1604 raise 1604 raise
1605 else: 1605 else:
1606 logger.warn('Failed to fetch URL %s, attempting MIRRORS if available' % u) 1606 logger.warning('Failed to fetch URL %s, attempting MIRRORS if available' % u)
1607 logger.debug(1, str(e)) 1607 logger.debug(1, str(e))
1608 firsterr = e 1608 firsterr = e
1609 # Remove any incomplete fetch 1609 # Remove any incomplete fetch
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index e8d9b11099..d9e46b2e8c 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -251,14 +251,14 @@ class Npm(FetchMethod):
251 with open(shwrf) as datafile: 251 with open(shwrf) as datafile:
252 shrinkobj = json.load(datafile) 252 shrinkobj = json.load(datafile)
253 except: 253 except:
254 logger.warn('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname) 254 logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
255 lckdf = d.getVar('NPM_LOCKDOWN', True) 255 lckdf = d.getVar('NPM_LOCKDOWN', True)
256 logger.debug(2, "NPM lockdown file is %s" % lckdf) 256 logger.debug(2, "NPM lockdown file is %s" % lckdf)
257 try: 257 try:
258 with open(lckdf) as datafile: 258 with open(lckdf) as datafile:
259 lockdown = json.load(datafile) 259 lockdown = json.load(datafile)
260 except: 260 except:
261 logger.warn('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname) 261 logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
262 262
263 if ('name' not in shrinkobj): 263 if ('name' not in shrinkobj):
264 self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud) 264 self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud)