mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-09 13:11:58 +08:00
WIP: debug internal binary for darwin
This commit is contained in:
parent
be66d91d30
commit
32f9d21c53
1 changed files with 5 additions and 1 deletions
|
@ -44,6 +44,7 @@ def get_restic_internal_binary(arch: str) -> str:
|
||||||
# We don't have restic legacy builds for unixes
|
# We don't have restic legacy builds for unixes
|
||||||
# so we can drop the -legacy suffix
|
# so we can drop the -legacy suffix
|
||||||
arch = arch.replace("-legacy", "")
|
arch = arch.replace("-legacy", "")
|
||||||
|
print(sys.platform.lower())
|
||||||
if sys.platform.lower() == "darwin":
|
if sys.platform.lower() == "darwin":
|
||||||
if arch == "arm64":
|
if arch == "arm64":
|
||||||
binary = "restic_*_darwin_arm64"
|
binary = "restic_*_darwin_arm64"
|
||||||
|
@ -58,11 +59,14 @@ def get_restic_internal_binary(arch: str) -> str:
|
||||||
binary = "restic_*_linux_amd64"
|
binary = "restic_*_linux_amd64"
|
||||||
else:
|
else:
|
||||||
binary = "restic_*_linux_386"
|
binary = "restic_*_linux_386"
|
||||||
|
else:
|
||||||
|
logger.info("Internal binary directory not set")
|
||||||
|
return None
|
||||||
if binary:
|
if binary:
|
||||||
guessed_path = glob.glob(os.path.join(RESTIC_SOURCE_FILES_DIR, binary))
|
guessed_path = glob.glob(os.path.join(RESTIC_SOURCE_FILES_DIR, binary))
|
||||||
if guessed_path:
|
if guessed_path:
|
||||||
# Take glob results reversed so we get newer version
|
# Take glob results reversed so we get newer version
|
||||||
# Does not always compute, but is g00denough(TM) for our dev
|
# Does not always compute, but is g00denough(TM) for our dev
|
||||||
return guessed_path[-1]
|
return guessed_path[-1]
|
||||||
logger.info(f"Could not find internal restic bianry in {guessed_path}")
|
logger.info(f"Could not find internal restic binary, guess {os.path.join(RESTIC_SOURCE_FILES_DIR, binary)} in {guessed_path}")
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Reference in a new issue