From f1e3de0d77c3a6c4c8d64b5d725f710de7a48e79 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Thu, 6 Jan 2022 00:37:03 +0100 Subject: [PATCH] [4.3] Use $YNH_ARCH instead of ynh_detect_arch --- conf/{x86-64.src => amd64.src} | 0 manifest.json | 4 ++-- scripts/install | 6 ++---- scripts/upgrade | 4 +--- scripts/ynh_detect_arch__2 | 25 ------------------------- 5 files changed, 5 insertions(+), 34 deletions(-) rename conf/{x86-64.src => amd64.src} (100%) delete mode 100644 scripts/ynh_detect_arch__2 diff --git a/conf/x86-64.src b/conf/amd64.src similarity index 100% rename from conf/x86-64.src rename to conf/amd64.src diff --git a/manifest.json b/manifest.json index 6a4936e..2ae58e1 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" }, - "version": "5.35~ynh1", + "version": "5.35~ynh2", "url": "https://wekan.github.io", "upstream": { "license": "MIT", @@ -29,7 +29,7 @@ } ], "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 65fc7ef..01faa4e 100644 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_detect_arch__2 source ynh_mongo_db source /usr/share/yunohost/helpers @@ -37,9 +36,8 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." -architecture=$(ynh_detect_arch) # Check machine architecture (in particular, we don't support ARM and 32bit machines) -if [ $architecture == "i386" ] || [ $architecture == "arm" ] +if [ $YNH_ARCH == "i386" ] || [ $YNH_ARCH == "armel" ] then ynh_die --message="Sorry, but this app can only be installed on a x86, 64 bits machine :(" fi @@ -104,7 +102,7 @@ ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" +ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" chmod 750 "$final_path" chmod -R o-rwx "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 2ddddc3..9cd5e08 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ source _common.sh source ynh_package_version -source ynh_detect_arch__2 source ynh_mongo_db source /usr/share/yunohost/helpers @@ -139,9 +138,8 @@ then # Remove the app directory securely ynh_secure_remove --file="$final_path" - architecture=$(ynh_detect_arch) # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" #Copy the admin saved settings from tmp directory to final path cp -af "$tmpdir/.env" "$final_path/.env" diff --git a/scripts/ynh_detect_arch__2 b/scripts/ynh_detect_arch__2 deleted file mode 100644 index b1c7375..0000000 --- a/scripts/ynh_detect_arch__2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. - -ynh_detect_arch(){ - local architecture - if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" - elif [ -n "$(uname -m | grep 64)" ]; then - architecture="x86-64" - elif [ -n "$(uname -m | grep 86)" ]; then - architecture="i386" - elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" - else - architecture="unknown" - fi - echo $architecture -}