Use restic 0.16.2 as last binary for legacy builds

This commit is contained in:
Orsiris de Jong 2024-11-11 21:11:40 +01:00
parent afee1587f0
commit fd2f116596
2 changed files with 7 additions and 2 deletions

View file

@ -22,7 +22,9 @@ for platform in "${platforms[@]}"; do
echo "Moving earlier version to archive"
[ -d ARCHIVES ] || mkdir ARCHIVES
mv -f restic_*_${platform} ARCHIVES/ > /dev/null 2>&1
mv -f restic_*_${platform}.exe ARCHIVES/ > /dev/null 2>&1
# Move all except restic legacy binary
mv -f !(restic_0.16.2_${platform}.exe) ARCHIVES/ > /dev/null 2>&1
# Avoid moving restic
echo "Downloading ${restic_filename}"
if [ "${platform:0:7}" == "windows" ]; then
ext=zip

View file

@ -13,7 +13,7 @@ __build__ = "2023061102"
import os
import sys
import glob
from npbackup.path_helper import BASEDIR
from npbackup.path_helper import BASEDIR, IS_LEGACY
RESTIC_SOURCE_FILES_DIR = os.path.join(BASEDIR, os.pardir, "RESTIC_SOURCE_FILES")
@ -23,6 +23,9 @@ def get_restic_internal_binary(arch: str) -> str:
binary = None
if os.path.isdir(RESTIC_SOURCE_FILES_DIR):
if os.name == "nt":
if IS_LEGACY and arch == "x86":
# Last compatible restic binary for Windows 7, see https://github.com/restic/restic/issues/5065
binary = "restic_0.16.2_windows_386.exe"
if arch == "x64":
binary = "restic_*_windows_amd64.exe"
else: