From db3e686de7a1ab3671573b5a6339bad04b8e0c0e Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 5 Aug 2022 11:05:58 +0200 Subject: [PATCH] Fix architecture detection --- scripts/_common.sh | 30 ++++++++++++++++-------------- scripts/install | 1 + scripts/upgrade | 1 + 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 38e50e9..46cf29b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,23 +4,25 @@ # COMMON VARIABLES #================================================= -case YNH_ARCH in - amd64) - PHOTOPRISM_VERSION="sha256:2a2fc58d5bf77642424854158a06713ce532026bd18a43e07fd71d75365cb8d3" - ;; +function detect_arch() { + case "$YNH_ARCH" in + "amd64") + PHOTOPRISM_VERSION="sha256:2a2fc58d5bf77642424854158a06713ce532026bd18a43e07fd71d75365cb8d3" + ;; - arm64) - PHOTOPRISM_VERSION="sha256:ad6de95e77e90a64487085b55dbdbea21c04aff5a17ca3c8790d1deae19b9ee1" - ;; + "arm64") + PHOTOPRISM_VERSION="sha256:ad6de95e77e90a64487085b55dbdbea21c04aff5a17ca3c8790d1deae19b9ee1" + ;; - armhf) - PHOTOPRISM_VERSION="sha256:4e0b39a06e0f7ecd11aa8cbd84c739cba3417c99348f52e3433cdeaeeb5474cb" - ;; + "armhf") + PHOTOPRISM_VERSION="sha256:4e0b39a06e0f7ecd11aa8cbd84c739cba3417c99348f52e3433cdeaeeb5474cb" + ;; - *) - ynh_die --message="Your server architecture ($YNH_ARCH) is not supported." - ;; -esac + *) + ynh_die --message="Your server architecture ($YNH_ARCH) is not supported." + ;; + esac +} #pkg_dependencies="libc6-dev libssl-dev libxft-dev libhdf5-serial-dev libpng-dev libheif-examples librsvg2-bin libx264-dev libx265-dev libnss3 libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev libzmq3-dev" pkg_dependencies="" diff --git a/scripts/install b/scripts/install index a20ae08..5716846 100755 --- a/scripts/install +++ b/scripts/install @@ -124,6 +124,7 @@ ynh_script_progression --message="Making install..." # Install photoprism pushd $final_path/build + detect_arch ./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION popd mkdir -p "$final_path/live/" diff --git a/scripts/upgrade b/scripts/upgrade index 1e244b6..1ae7ca4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,6 +120,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then # Install photoprism pushd $final_path/build + detect_arch ./docker-image-extract photoprism/photoprism:$PHOTOPRISM_VERSION popd mkdir -p "$final_path/live/"