diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-02-27 14:34:02 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-02-27 14:34:02 -0600 |
commit | 7553795ec2d735c01dbdde129a65b7f45d5aa999 (patch) | |
tree | b3970009a8246b0c17a105fe6b10c8077fc2b763 /harmony/parted/tests-python3.patch | |
parent | e2b01859c88d221992403d1293d42da33002be4d (diff) | |
download | packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.gz packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.bz2 packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.xz packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.zip |
Add harmony/ repo for packages still being discussed
See https://wiki.adelielinux.org/wiki/Project:Harmony
Diffstat (limited to 'harmony/parted/tests-python3.patch')
-rw-r--r-- | harmony/parted/tests-python3.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/harmony/parted/tests-python3.patch b/harmony/parted/tests-python3.patch new file mode 100644 index 000000000..8811b7237 --- /dev/null +++ b/harmony/parted/tests-python3.patch @@ -0,0 +1,68 @@ +--- parted-3.2/tests/gpt-header-move.old 2014-06-15 18:27:30.000000000 +0000 ++++ parted-3.2/tests/gpt-header-move 2017-08-19 20:47:02.443283140 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + + # open img file, subtract 33 from altlba address, and move the last 33 sectors + # back by 33 sectors +@@ -11,12 +11,12 @@ + file.seek(512) + gptheader = file.read(512) + altlba = unpack_from('<q', gptheader,offset=32)[0] +-gptheader = array.array('c',gptheader) ++gptheader = array.array('B',gptheader) + pack_into('<Q', gptheader, 32, altlba-33) + #zero header crc + pack_into('<L', gptheader, 16, 0) + #compute new crc +-newcrc = ((crc32(buffer(gptheader,0,92))) & 0xFFFFFFFF) ++newcrc = ((crc32(memoryview(gptheader[0:92]))) & 0xFFFFFFFF) + pack_into('<L', gptheader, 16, newcrc) + file.seek(512) + file.write(gptheader) +@@ -25,7 +25,7 @@ + file.seek(512*(altlba-32)) + backup = file.read(512*32) + altlba -= 33 +-gptheader = array.array('c',gptheader) ++gptheader = array.array('B',gptheader) + #update mylba + pack_into('<Q', gptheader, 24, altlba) + #update table lba +@@ -33,7 +33,7 @@ + #zero header crc + pack_into('<L', gptheader, 16, 0) + #compute new crc +-newcrc = ((crc32(buffer(gptheader,0,92))) & 0xFFFFFFFF) ++newcrc = ((crc32(memoryview(gptheader[0:92]))) & 0xFFFFFFFF) + pack_into('<L', gptheader, 16, newcrc) + file.seek(512*(altlba-32)) + file.write(backup) +@@ -38,4 +38,4 @@ + file.seek(512*(altlba-32)) + file.write(backup) + file.write(gptheader) +-file.write("\0" * (512 * 33)) ++file.write(b"\0" * (512 * 33)) +--- parted-3.2/tests/msdos-overlap.old 2014-06-15 18:27:30.000000000 +0000 ++++ parted-3.2/tests/msdos-overlap 2017-08-19 20:48:16.279847771 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + """ + Write an overlapping partition to a msdos disk + +@@ -14,10 +14,10 @@ + OFFSET = 0x1b8 + + if len(sys.argv) < 2: +- print "%s: <image or device>" ++ print("%s: <image or device>") + sys.exit(1) + +-data = "".join(chr(c) for c in BAD_ENTRY) ++data = bytearray(BAD_ENTRY) + with open(sys.argv[1], "rb+") as f: + f.seek(OFFSET, 0) + f.write(data) |