Fix compiling on legacy linux

This commit is contained in:
deajan 2025-04-18 22:41:28 +02:00
parent 75568a2273
commit 3704eb2683

View file

@ -26,7 +26,7 @@ def get_restic_internal_binary(arch: str) -> str:
binary = None binary = None
if os.path.isdir(RESTIC_SOURCE_FILES_DIR): if os.path.isdir(RESTIC_SOURCE_FILES_DIR):
if os.name == "nt": if os.name == "nt":
if IS_LEGACY: if IS_LEGACY or "legacy" in "arch":
# Last compatible restic binary for Windows 7, see https://github.com/restic/restic/issues/5065 # Last compatible restic binary for Windows 7, see https://github.com/restic/restic/issues/5065
# We build a legacy version of restic for windows 7 and Server 2008R2 # We build a legacy version of restic for windows 7 and Server 2008R2
logger.info( logger.info(
@ -40,7 +40,11 @@ def get_restic_internal_binary(arch: str) -> str:
binary = "restic_*_windows_386.exe" binary = "restic_*_windows_386.exe"
else: else:
binary = "restic_*_windows_amd64.exe" binary = "restic_*_windows_amd64.exe"
elif sys.platform.lower() == "darwin": else:
# We don't have restic legacy builds for unixes
# so we can drop the -legacy suffix
arch = arch.replace("-legacy", "")
if sys.platform.lower() == "darwin":
if arch == "arm64": if arch == "arm64":
binary = "restic_*_darwin_arm64" binary = "restic_*_darwin_arm64"
else: else: