mirror of
https://github.com/YunoHost-Apps/jackett_ynh.git
synced 2024-09-03 19:26:28 +02:00
Merge pull request #4 from YunoHost-Apps/architectures
Improve architecture detection
This commit is contained in:
commit
9bfe8d694a
3 changed files with 22 additions and 7 deletions
|
@ -4,15 +4,26 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
architecture=$(dpkg --print-architecture)
|
||||
if [ $architecture = "amd64" ]; then
|
||||
architecture="x64"
|
||||
fi
|
||||
# Supported architectures
|
||||
supported_architectures=("arm" "arm64" "x64")
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
get_architecture() {
|
||||
architecture=$(dpkg --print-architecture)
|
||||
if [ $architecture = "amd64" ]; then
|
||||
architecture="x64"
|
||||
elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 32 ]]; then
|
||||
architecture="arm"
|
||||
elif [[ $architecture = arm* ]] && [[ $(getconf LONG_BIT) = 64 ]]; then
|
||||
architecture="arm64"
|
||||
elif [[ $(echo ${supported_architectures[@]} | grep -ow "$architecture" | wc -w) = 0 ]]; then
|
||||
ynh_die --message="Unsupported architecture $architecture"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -68,7 +68,9 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..."
|
||||
ynh_script_progression --message="Setting up source files..."
|
||||
|
||||
get_architecture
|
||||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
|
|
|
@ -112,10 +112,12 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
|
||||
get_architecture
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
ynh_setup_source --dest_dir="$final_path" --source_id="app.$architecture"
|
||||
fi
|
||||
|
||||
# FIXME: this should be managed by the core in the future
|
||||
|
|
Loading…
Reference in a new issue