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/conf/armv7.src b/conf/armhf.src similarity index 100% rename from conf/armv7.src rename to conf/armhf.src diff --git a/conf/armv6.src b/conf/armv6.src deleted file mode 100644 index 8fb33de..0000000 --- a/conf/armv6.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/khlieng/dispatch/releases/download/v0.7/dispatch_0.7_linux_armv6.tar.gz -SOURCE_SUM=dad01b72d80857830175cd7c2f9c5a82f4e59a72edea558ed7869de6bded8d80 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false diff --git a/scripts/_common.sh b/scripts/_common.sh index 9badc39..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,26 +15,3 @@ #================================================= # FUTURE OFFICIAL HELPERS #================================================= - -# 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 armv7)" ]; then - architecture="armv7" - elif [ -n "$(uname -m | grep armv6)" ]; then - architecture="armv6" - else - architecture="unknown" - fi - echo $architecture -} diff --git a/scripts/install b/scripts/install index 1e180ea..af0c6c8 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -architecture=$(ynh_detect_arch) +architecture=$YNH_ARCH app=$YNH_APP_INSTANCE_NAME @@ -45,6 +45,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url +ynh_app_setting_set --app=$app --key=architecture --value=$architecture #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index 8065b9d..9336c1c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -architecture=$(ynh_detect_arch) +architecture=$(ynh_app_setting_get --app=$app --key=architecture) #================================================= # CHECK VERSION @@ -34,6 +34,12 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# If architecture doesn't exist, create it +if [ -z "$architecture" ]; then + architecture=$YNH_ARCH + architecture=$(ynh_app_setting_get --app=$app --key=architecture) +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all