From 03090b031ef045605b9ded880968ae88a755a552 Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 21 May 2020 14:50:44 -0400 Subject: [PATCH] Reuse existing ImageBuilder archive for release versions --- openwrtBuild | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openwrtBuild b/openwrtBuild index b459217..f7afb6c 100755 --- a/openwrtBuild +++ b/openwrtBuild @@ -205,9 +205,13 @@ acquireImageBuilder() { local _url _filename if [[ "$_version" == "snapshot" ]]; then + # Remove existing ImageBuilders + [[ -f "$_source_archive" ]] && rm "$_source_archive" _filename="openwrt-imagebuilder-${_target//\//-}.Linux-x86_64.tar.xz" _url="https://downloads.openwrt.org/snapshots/targets/$_target/$_filename" else + # Reuse existing ImageBuilders + [[ -f "$_source_archive" ]] && return 0 _filename="openwrt-imagebuilder-$_version-${_target//\//-}.Linux-x86_64.tar.xz" _url="https://downloads.openwrt.org/releases/$_version/targets/$_target/$_filename" fi @@ -215,9 +219,6 @@ acquireImageBuilder() { # Make sources directory if it does not exist [[ ! -d "$_builddir/sources" ]] && mkdir -p "$_builddir/sources" - # Remove existing ImageBuilder archives - [[ -f "$_source_archive" ]] && rm "$_source_archive" - echo "Downloading image archive" debug "axel -o $_source_archive $_url" if ! axel -o "$_source_archive" "$_url" > /dev/null 2>&1; then