[depends] native_mac_alias 2.0.6
[bitcoinplatinum.git] / depends / patches / native_mac_alias / python3.patch
blob6f2f5534a275d57d3dcb8287823b85e663152904
1 diff -dur a/mac_alias/alias.py b/mac_alias/alias.py
2 --- a/mac_alias/alias.py
3 +++ b/mac_alias/alias.py
4 @@ -258,10 +258,10 @@
5 alias = Alias()
6 alias.appinfo = appinfo
8 - alias.volume = VolumeInfo (volname.replace('/',':'),
9 + alias.volume = VolumeInfo (volname.decode().replace('/',':'),
10 voldate, fstype, disktype,
11 volattrs, volfsid)
12 - alias.target = TargetInfo (kind, filename.replace('/',':'),
13 + alias.target = TargetInfo (kind, filename.decode().replace('/',':'),
14 folder_cnid, cnid,
15 crdate, creator_code, type_code)
16 alias.target.levels_from = levels_from
17 @@ -276,9 +276,9 @@
18 b.read(1)
20 if tag == TAG_CARBON_FOLDER_NAME:
21 - alias.target.folder_name = value.replace('/',':')
22 + alias.target.folder_name = value.decode().replace('/',':')
23 elif tag == TAG_CNID_PATH:
24 - alias.target.cnid_path = struct.unpack(b'>%uI' % (length // 4),
25 + alias.target.cnid_path = struct.unpack('>%uI' % (length // 4),
26 value)
27 elif tag == TAG_CARBON_PATH:
28 alias.target.carbon_path = value
29 @@ -313,9 +313,9 @@
30 alias.target.creation_date \
31 = mac_epoch + datetime.timedelta(seconds=seconds)
32 elif tag == TAG_POSIX_PATH:
33 - alias.target.posix_path = value
34 + alias.target.posix_path = value.decode()
35 elif tag == TAG_POSIX_PATH_TO_MOUNTPOINT:
36 - alias.volume.posix_path = value
37 + alias.volume.posix_path = value.decode()
38 elif tag == TAG_RECURSIVE_ALIAS_OF_DISK_IMAGE:
39 alias.volume.disk_image_alias = Alias.from_bytes(value)
40 elif tag == TAG_USER_HOME_LENGTH_PREFIX:
41 @@ -467,12 +467,12 @@
43 b.write(struct.pack(b'>hhQhhQ',
44 TAG_HIGH_RES_VOLUME_CREATION_DATE,
45 - 8, long(voldate * 65536),
46 + 8, int(voldate * 65536),
47 TAG_HIGH_RES_CREATION_DATE,
48 - 8, long(crdate * 65536)))
49 + 8, int(crdate * 65536)))
51 if self.target.cnid_path:
52 - cnid_path = struct.pack(b'>%uI' % len(self.target.cnid_path),
53 + cnid_path = struct.pack('>%uI' % len(self.target.cnid_path),
54 *self.target.cnid_path)
55 b.write(struct.pack(b'>hh', TAG_CNID_PATH,
56 len(cnid_path)))