mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Possible fix for Apple screwing with device node names reported in statfs structures in macOS 13
This commit is contained in:
parent
fdbf44e3bd
commit
53924284c8
@ -393,6 +393,16 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
bsd_drives = self.osx_bsd_names()
|
bsd_drives = self.osx_bsd_names()
|
||||||
drives = self.osx_sort_names(bsd_drives.copy())
|
drives = self.osx_sort_names(bsd_drives.copy())
|
||||||
mount_map = get_mounted_filesystems()
|
mount_map = get_mounted_filesystems()
|
||||||
|
# macOS 13 Ventura uses a weird scheme for mounted FAT devices of the
|
||||||
|
# form fat://basename_of_bsd_name/basename_of_mountpoint
|
||||||
|
# see https://www.mobileread.com/forums/showthread.php?t=347294
|
||||||
|
for dev_node in tuple(mount_map):
|
||||||
|
if ':' in dev_node and '//' in dev_node:
|
||||||
|
val = mount_map[dev_node]
|
||||||
|
dev_node = dev_node.split('/')[-2]
|
||||||
|
dev_node = f'/dev/{dev_node}'
|
||||||
|
if dev_node not in mount_map:
|
||||||
|
mount_map[dev_node] = val
|
||||||
drives = {k: mount_map.get(v) for k, v in iteritems(drives)}
|
drives = {k: mount_map.get(v) for k, v in iteritems(drives)}
|
||||||
if is_debugging():
|
if is_debugging():
|
||||||
print()
|
print()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user