comparison cutils/treesum.py @ 218:dee891ed2307

FIX: Output of symlinks was not converted property but was written in bytes repr
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 25 Jan 2025 09:56:19 +0100
parents 8e38c07c4b85
children 19eaba51c632
comparison
equal deleted inserted replaced
217:8e38c07c4b85 218:dee891ed2307
664 opath = walk.WalkDirEntry.alt_u8(opath) 664 opath = walk.WalkDirEntry.alt_u8(opath)
665 else: 665 else:
666 opath = walk.WalkDirEntry.alt_fs(opath) 666 opath = walk.WalkDirEntry.alt_fs(opath)
667 if self._size_only: 667 if self._size_only:
668 self._outfp.write(format_bsd_line( 668 self._outfp.write(format_bsd_line(
669 "SIZE", None, "%s/./@/" % (opath,), False, 0)) 669 "SIZE", None,
670 util.interpolate_bytes(b"%s/./@/", opath),
671 False, 0))
670 else: 672 else:
671 self._outfp.write(format_bsd_line( 673 self._outfp.write(format_bsd_line(
672 self._algorithm[1], 674 self._algorithm[1],
673 linkdgst.digest(), 675 linkdgst.digest(),
674 "%s/./@/" % (opath,), 676 util.interpolate_bytes(b"%s/./@/", opath),
675 self._use_base64)) 677 self._use_base64))
676 self._outfp.flush() 678 self._outfp.flush()
677 else: 679 else:
678 # 680 #
679 # Follow the symlink to dir or handle a "real" directory 681 # Follow the symlink to dir or handle a "real" directory
775 opath = walk.WalkDirEntry.alt_u8(opath) 777 opath = walk.WalkDirEntry.alt_u8(opath)
776 else: 778 else:
777 opath = walk.WalkDirEntry.alt_fs(opath) 779 opath = walk.WalkDirEntry.alt_fs(opath)
778 if self._size_only: 780 if self._size_only:
779 self._outfp.write(format_bsd_line( 781 self._outfp.write(format_bsd_line(
780 "SIZE", None, "%s/./@" % (opath,), False, 0)) 782 "SIZE", None,
783 util.interpolate_bytes(b"%s/./@", opath),
784 False, 0))
781 else: 785 else:
782 self._outfp.write(format_bsd_line( 786 self._outfp.write(format_bsd_line(
783 self._algorithm[1], 787 self._algorithm[1],
784 linkdgst.digest(), 788 linkdgst.digest(),
785 "%s/./@" % (opath,), 789 util.interpolate_bytes(b"%s/./@", opath),
786 self._use_base64)) 790 self._use_base64))
787 self._outfp.flush() 791 self._outfp.flush()
788 else: 792 else:
789 # follow symlinks to files 793 # follow symlinks to files
790 if self._utf8_mode: 794 if self._utf8_mode: