Add darwin upgrade support

This commit is contained in:
Orsiris de Jong 2025-06-29 16:31:32 +02:00
parent 0dc9409f55
commit 0fdb267275

View file

@ -6,7 +6,7 @@ __intname__ = "npbackup.restic_update"
__author__ = "Orsiris de Jong"
__copyright__ = "Copyright (C) 2024-2025 NetInvent"
__license__ = "BSD-3-Clause"
__build__ = "2025040801"
__build__ = "2025062901"
import os
import sys
@ -49,6 +49,9 @@ def download_restic_binaries(arch: str = "amd64") -> bool:
fname = f"_windows_{arch}"
suffix = ".exe"
arch_suffix = ".zip"
elif sys.platform.lower() == "darwin":
fname = f"_darwin_{arch}"
arch_suffix = ".bz2"
else:
fname = f"_linux_{arch}"
suffix = ""
@ -58,6 +61,7 @@ def download_restic_binaries(arch: str = "amd64") -> bool:
os.makedirs(dest_dir.joinpath("ARCHIVES"))
dest_file = dest_dir.joinpath("restic_" + current_version + fname + suffix)
print(f"Projected dest file is {dest_file}")
if dest_file.is_file():
print(f"RESTIC SOURCE ALREADY PRESENT. NOT DOWNLOADING {dest_file}")