diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-02-15 03:23:48 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-02-15 03:23:48 +0000 |
commit | 3b46527da85b8139d5fcf887387bcd4de20dec41 (patch) | |
tree | 35fa0fbaeaaddd9cc2a126a05eee3527b51e83a8 /chromiumos_image_diff.py | |
parent | 62564f20dc6f3a88caed664d54fc00dbf3bf7373 (diff) | |
parent | b75f321fc8978b92ce3db6886ccb966768f0c7a8 (diff) | |
download | toolchain-utils-android11-d1-s5-release.tar.gz |
Snap for 6210127 from b75f321fc8978b92ce3db6886ccb966768f0c7a8 to rvc-d1-releaseandroid-11.0.0_r9android-11.0.0_r8android-11.0.0_r7android-11.0.0_r15android-11.0.0_r14android-11.0.0_r13android-11.0.0_r12android-11.0.0_r11android-11.0.0_r10android11-d1-s7-releaseandroid11-d1-s6-releaseandroid11-d1-s5-releaseandroid11-d1-s1-releaseandroid11-d1-release
Change-Id: I508eae962f523cfa857b4da7c77fdb8a70dfab1e
Diffstat (limited to 'chromiumos_image_diff.py')
-rwxr-xr-x | chromiumos_image_diff.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chromiumos_image_diff.py b/chromiumos_image_diff.py index 74906d32..66a54ccc 100755 --- a/chromiumos_image_diff.py +++ b/chromiumos_image_diff.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2019 The Chromium OS Authors. All rights reserved. @@ -86,7 +86,7 @@ class CrosImage(object): '{r}/var {r}/mnt/stateful_partition {r}; sudo umount {s} ; ' 'rmdir {r} ; rmdir {s}\n').format( r=self.rootfs, s=self.stateful) - f = open(self.unmount_script, 'w') + f = open(self.unmount_script, 'w', encoding='utf-8') f.write(command) f.close() self._ce.RunCommand( @@ -160,9 +160,9 @@ class ImageComparator(object): i1 = self.images[0] i2 = self.images[1] t1 = i1.rootfs + '/' - elfset1 = set([e.replace(t1, '') for e in i1.elf_files]) + elfset1 = {e.replace(t1, '') for e in i1.elf_files} t2 = i2.rootfs + '/' - elfset2 = set([e.replace(t2, '') for e in i2.elf_files]) + elfset2 = {e.replace(t2, '') for e in i2.elf_files} dif1 = elfset1.difference(elfset2) msg = None if dif1: @@ -210,15 +210,15 @@ class ImageComparator(object): if full_path1 == full_path2: self.logger.LogError( - 'Error: We\'re comparing the SAME file - {0}'.format(f1)) + "Error: We're comparing the SAME file - {0}".format(f1)) continue command = ( 'objdump -d "{f1}" > {tempf1} ; ' 'objdump -d "{f2}" > {tempf2} ; ' # Remove path string inside the dissemble - 'sed -i \'s!{rootfs1}!!g\' {tempf1} ; ' - 'sed -i \'s!{rootfs2}!!g\' {tempf2} ; ' + "sed -i 's!{rootfs1}!!g' {tempf1} ; " + "sed -i 's!{rootfs2}!!g' {tempf2} ; " 'diff {tempf1} {tempf2} 1>/dev/null 2>&1').format( f1=full_path1, f2=full_path2, |