From 170b9375c508d955e005ffd16616093061e973be Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Thu, 3 Aug 2023 07:58:43 +0000 Subject: [PATCH] add possibility to download a specific release --- README.md | 7 ++++++- build.sh | 13 +++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 00fa0ac..e1f4441 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,16 @@ At least 4 GB are required for compiling. On devices with low memory, SWAP must ## Download pre-built packages You can find unoffical debian packages for bullseye that are created with the build.sh script and github actions at https://github.com/wofferl/proxmox-backup-arm64/releases. -With the script you can also download all files of the latest release at once. +With the script you can also download all files of the latest release at once ``` ./build.sh download ``` +or of a specific version +``` +./build.sh download=2.4.3-1 +``` + ## Build manually ### Install build essentials and dependencies ``` diff --git a/build.sh b/build.sh index 27a24dc..78ff174 100755 --- a/build.sh +++ b/build.sh @@ -138,8 +138,9 @@ function set_package_info() { } function download_release() { - release_url="https://api.github.com/repos/wofferl/proxmox-backup-arm64/releases/latest" - echo "Downloading latest released files to "${PACKAGES} + version=${1:-latest} + release_url="https://api.github.com/repos/wofferl/proxmox-backup-arm64/releases/${version}" + echo "Downloading ${version} released files to "${PACKAGES} for download_url in $(curl -sSf ${release_url} | sed -n '/browser_download_url/ s/.*\(https.*\)"/\1/p'); do file=$(basename ${download_url}) if [ -e ${PACKAGES}/${file} ]; then @@ -188,8 +189,12 @@ do export CC=/usr/bin/aarch64-linux-gnu-gcc export DEB_HOST_MULTIARCH=aarch64-linux-gnu ;; - download) - download_release + download*) + if [[ "$1" =~ download=[0-9.-]+ ]]; then + download_release tags/${1/*=} + else + download_release + fi exit 0 ;; github)