summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
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/utils.py
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/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 5e735d3fa7..2abf518ece 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -822,7 +822,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
822 if not sstat: 822 if not sstat:
823 sstat = os.lstat(src) 823 sstat = os.lstat(src)
824 except Exception as e: 824 except Exception as e:
825 logger.warn("copyfile: stat of %s failed (%s)" % (src, e)) 825 logger.warning("copyfile: stat of %s failed (%s)" % (src, e))
826 return False 826 return False
827 827
828 destexists = 1 828 destexists = 1
@@ -849,7 +849,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
849 #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) 849 #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
850 return os.lstat(dest) 850 return os.lstat(dest)
851 except Exception as e: 851 except Exception as e:
852 logger.warn("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e)) 852 logger.warning("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e))
853 return False 853 return False
854 854
855 if stat.S_ISREG(sstat[stat.ST_MODE]): 855 if stat.S_ISREG(sstat[stat.ST_MODE]):
@@ -864,7 +864,7 @@ def copyfile(src, dest, newmtime = None, sstat = None):
864 shutil.copyfile(src, dest + "#new") 864 shutil.copyfile(src, dest + "#new")
865 os.rename(dest + "#new", dest) 865 os.rename(dest + "#new", dest)
866 except Exception as e: 866 except Exception as e:
867 logger.warn("copyfile: copy %s to %s failed (%s)" % (src, dest, e)) 867 logger.warning("copyfile: copy %s to %s failed (%s)" % (src, dest, e))
868 return False 868 return False
869 finally: 869 finally:
870 if srcchown: 870 if srcchown:
@@ -875,13 +875,13 @@ def copyfile(src, dest, newmtime = None, sstat = None):
875 #we don't yet handle special, so we need to fall back to /bin/mv 875 #we don't yet handle special, so we need to fall back to /bin/mv
876 a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") 876 a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'")
877 if a[0] != 0: 877 if a[0] != 0:
878 logger.warn("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a)) 878 logger.warning("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a))
879 return False # failure 879 return False # failure
880 try: 880 try:
881 os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID]) 881 os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
882 os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown 882 os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
883 except Exception as e: 883 except Exception as e:
884 logger.warn("copyfile: failed to chown/chmod %s (%s)" % (dest, e)) 884 logger.warning("copyfile: failed to chown/chmod %s (%s)" % (dest, e))
885 return False 885 return False
886 886
887 if newmtime: 887 if newmtime: