1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 17:57:59 +00:00

mount: make up volname if not given (macOS), fixes #7690

macFUSE supports a volname mount option to give what
finder displays on desktop / in directory list.

if the user did not specify it, we make something up,
because otherwise it would be "macFUSE Volume 0 (Python)".
This commit is contained in:
Thomas Waldmann 2023-06-30 22:06:45 +02:00
parent c539b404f6
commit bd9af62c07
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -44,6 +44,7 @@ def async_wrapper(fn):
from .helpers.lrucache import LRUCache
from .item import Item
from .platform import uid2user, gid2group
from .platformflags import is_darwin
from .remote import RemoteRepository
@ -513,6 +514,13 @@ def pop_option(options, key, present, not_present, wanted_type, int_base=0):
options = ["fsname=borgfs", "ro", "default_permissions"]
if mount_options:
options.extend(mount_options.split(","))
if is_darwin:
# macFUSE supports a volname mount option to give what finder displays on desktop / in directory list.
volname = pop_option(options, "volname", "", "", str)
# if the user did not specify it, we make something up,
# because otherwise it would be "macFUSE Volume 0 (Python)", #7690.
volname = volname or f"{os.path.basename(mountpoint)} (borgfs)"
options.append(f"volname={volname}")
ignore_permissions = pop_option(options, "ignore_permissions", True, False, bool)
if ignore_permissions:
# in case users have a use-case that requires NOT giving "default_permissions",