diff --git a/scripts/_common.sh b/scripts/_common.sh index a366e7f..e5be016 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,30 +19,6 @@ package_check_dependencies="xserver-xorg-video-dummy" # EXPERIMENTAL 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 86)" ]; then - architecture="i386" - elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" - else - architecture="unknown" - fi - echo $architecture -} - #================================================= # FUTURE OFFICIAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 3e22a51..65a7fa5 100644 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,6 @@ path_url=$YNH_APP_ARG_PATH is_public=1 launch_on_boot=$YNH_APP_ARG_LAUNCH_ON_BOOT open_webserver_port=$YNH_APP_ARG_OPEN_WEBSERVER_PORT -arch=$(ynh_detect_arch) app=$YNH_APP_INSTANCE_NAME @@ -89,7 +88,7 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then pkg_dependencies="$pkg_dependencies $package_check_dependencies" fi -if [[ $arch != arm* ]]; then +if [[ $YNH_ARCH != arm* ]]; then ynh_install_app_dependencies $pkg_dependencies else ynh_install_app_dependencies $arm_pkg_dependencies @@ -133,7 +132,7 @@ mkdir -p "$final_path/.kodi/userdata/" ynh_add_config --template="../conf/advancedsettings.xml" --destination="$final_path/.kodi/userdata/advancedsettings.xml" mkdir -p "$final_path/.kodi/addons/" -if [[ $arch != arm* ]]; then +if [[ $YNH_ARCH != arm* ]]; then ynh_setup_source --dest_dir="$final_path/.kodi/addons/" --source_id="arm-chorus2" fi diff --git a/scripts/restore b/scripts/restore index 12ad8ec..7d2e195 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) launch_on_boot=$(ynh_app_setting_get --app=$app --key=launch_on_boot) open_webserver_port=$(ynh_app_setting_get --app=$app --key=open_webserver_port) port=$(ynh_app_setting_get --app=$app --key=port) -arch=$(ynh_detect_arch) #================================================= # FIND AND OPEN A PORT @@ -94,7 +93,7 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then pkg_dependencies="$pkg_dependencies $package_check_dependencies" fi -if [[ $arch != arm* ]]; then +if [[ $YNH_ARCH != arm* ]]; then ynh_install_app_dependencies $pkg_dependencies else ynh_install_app_dependencies $arm_pkg_dependencies diff --git a/scripts/upgrade b/scripts/upgrade index ec43132..906561a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) launch_on_boot=$(ynh_app_setting_get --app=$app --key=launch_on_boot) open_webserver_port=$(ynh_app_setting_get --app=$app --key=open_webserver_port) port=$(ynh_app_setting_get --app=$app --key=port) -arch=$(ynh_detect_arch) #================================================= # CHECK VERSION @@ -112,7 +111,7 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then pkg_dependencies="$pkg_dependencies $package_check_dependencies" fi -if [[ $arch != arm* ]]; then +if [[ $YNH_ARCH != arm* ]]; then ynh_install_app_dependencies $pkg_dependencies else ynh_install_app_dependencies $arm_pkg_dependencies