diff options
Diffstat (limited to 'bitbake/lib/bb/utils.py')
| -rw-r--r-- | bitbake/lib/bb/utils.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 5c6aafd1fa..7446be875d 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -562,7 +562,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 562 | if not sstat: | 562 | if not sstat: |
| 563 | sstat = os.lstat(src) | 563 | sstat = os.lstat(src) |
| 564 | except Exception, e: | 564 | except Exception, e: |
| 565 | print "movefile: Stating source file failed...", e | 565 | print("movefile: Stating source file failed...", e) |
| 566 | return None | 566 | return None |
| 567 | 567 | ||
| 568 | destexists = 1 | 568 | destexists = 1 |
| @@ -590,7 +590,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 590 | os.unlink(src) | 590 | os.unlink(src) |
| 591 | return os.lstat(dest) | 591 | return os.lstat(dest) |
| 592 | except Exception, e: | 592 | except Exception, e: |
| 593 | print "movefile: failed to properly create symlink:", dest, "->", target, e | 593 | print("movefile: failed to properly create symlink:", dest, "->", target, e) |
| 594 | return None | 594 | return None |
| 595 | 595 | ||
| 596 | renamefailed = 1 | 596 | renamefailed = 1 |
| @@ -601,7 +601,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 601 | except Exception, e: | 601 | except Exception, e: |
| 602 | if e[0] != errno.EXDEV: | 602 | if e[0] != errno.EXDEV: |
| 603 | # Some random error. | 603 | # Some random error. |
| 604 | print "movefile: Failed to move", src, "to", dest, e | 604 | print("movefile: Failed to move", src, "to", dest, e) |
| 605 | return None | 605 | return None |
| 606 | # Invalid cross-device-link 'bind' mounted or actually Cross-Device | 606 | # Invalid cross-device-link 'bind' mounted or actually Cross-Device |
| 607 | 607 | ||
| @@ -613,13 +613,13 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 613 | os.rename(dest + "#new", dest) | 613 | os.rename(dest + "#new", dest) |
| 614 | didcopy = 1 | 614 | didcopy = 1 |
| 615 | except Exception, e: | 615 | except Exception, e: |
| 616 | print 'movefile: copy', src, '->', dest, 'failed.', e | 616 | print('movefile: copy', src, '->', dest, 'failed.', e) |
| 617 | return None | 617 | return None |
| 618 | else: | 618 | else: |
| 619 | #we don't yet handle special, so we need to fall back to /bin/mv | 619 | #we don't yet handle special, so we need to fall back to /bin/mv |
| 620 | a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'") | 620 | a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'") |
| 621 | if a[0] != 0: | 621 | if a[0] != 0: |
| 622 | print "movefile: Failed to move special file:" + src + "' to '" + dest + "'", a | 622 | print("movefile: Failed to move special file:" + src + "' to '" + dest + "'", a) |
| 623 | return None # failure | 623 | return None # failure |
| 624 | try: | 624 | try: |
| 625 | if didcopy: | 625 | if didcopy: |
| @@ -627,7 +627,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
| 627 | os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown | 627 | os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown |
| 628 | os.unlink(src) | 628 | os.unlink(src) |
| 629 | except Exception, e: | 629 | except Exception, e: |
| 630 | print "movefile: Failed to chown/chmod/unlink", dest, e | 630 | print("movefile: Failed to chown/chmod/unlink", dest, e) |
| 631 | return None | 631 | return None |
| 632 | 632 | ||
| 633 | if newmtime: | 633 | if newmtime: |
| @@ -648,7 +648,7 @@ def copyfile(src, dest, newmtime = None, sstat = None): | |||
| 648 | if not sstat: | 648 | if not sstat: |
| 649 | sstat = os.lstat(src) | 649 | sstat = os.lstat(src) |
| 650 | except Exception, e: | 650 | except Exception, e: |
| 651 | print "copyfile: Stating source file failed...", e | 651 | print("copyfile: Stating source file failed...", e) |
| 652 | return False | 652 | return False |
| 653 | 653 | ||
| 654 | destexists = 1 | 654 | destexists = 1 |
| @@ -675,7 +675,7 @@ def copyfile(src, dest, newmtime = None, sstat = None): | |||
| 675 | #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) | 675 | #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) |
| 676 | return os.lstat(dest) | 676 | return os.lstat(dest) |
| 677 | except Exception, e: | 677 | except Exception, e: |
| 678 | print "copyfile: failed to properly create symlink:", dest, "->", target, e | 678 | print("copyfile: failed to properly create symlink:", dest, "->", target, e) |
| 679 | return False | 679 | return False |
| 680 | 680 | ||
| 681 | if stat.S_ISREG(sstat[stat.ST_MODE]): | 681 | if stat.S_ISREG(sstat[stat.ST_MODE]): |
| @@ -683,19 +683,19 @@ def copyfile(src, dest, newmtime = None, sstat = None): | |||
| 683 | shutil.copyfile(src, dest + "#new") | 683 | shutil.copyfile(src, dest + "#new") |
| 684 | os.rename(dest + "#new", dest) | 684 | os.rename(dest + "#new", dest) |
| 685 | except Exception, e: | 685 | except Exception, e: |
| 686 | print 'copyfile: copy', src, '->', dest, 'failed.', e | 686 | print('copyfile: copy', src, '->', dest, 'failed.', e) |
| 687 | return False | 687 | return False |
| 688 | else: | 688 | else: |
| 689 | #we don't yet handle special, so we need to fall back to /bin/mv | 689 | #we don't yet handle special, so we need to fall back to /bin/mv |
| 690 | a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") | 690 | a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'") |
| 691 | if a[0] != 0: | 691 | if a[0] != 0: |
| 692 | print "copyfile: Failed to copy special file:" + src + "' to '" + dest + "'", a | 692 | print("copyfile: Failed to copy special file:" + src + "' to '" + dest + "'", a) |
| 693 | return False # failure | 693 | return False # failure |
| 694 | try: | 694 | try: |
| 695 | os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID]) | 695 | os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID]) |
| 696 | os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown | 696 | os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown |
| 697 | except Exception, e: | 697 | except Exception, e: |
| 698 | print "copyfile: Failed to chown/chmod/unlink", dest, e | 698 | print("copyfile: Failed to chown/chmod/unlink", dest, e) |
| 699 | return False | 699 | return False |
| 700 | 700 | ||
| 701 | if newmtime: | 701 | if newmtime: |
