2021-05-21 14:24:10 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-25 23:28:22 +02:00
|
|
|
# Supported architectures
|
|
|
|
supported_architectures=("arm" "arm64" "x64")
|
2021-05-21 14:24:10 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-25 23:28:22 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-05-21 14:24:10 +02:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|