2021-11-08 21:48:50 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
2021-11-08 21:48:50 +01:00
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
|
|
|
|
2016-08-15 15:38:50 +02:00
|
|
|
# Detect the system architecture to download the right tarball
|
2016-10-18 00:09:26 +02:00
|
|
|
# NOTE: `uname -m` is more accurate and universal than `arch`
|
|
|
|
# See https://en.wikipedia.org/wiki/Uname
|
2020-11-20 10:09:41 +01:00
|
|
|
ynh_detect_arch(){
|
|
|
|
local architecture
|
2020-11-20 10:22:05 +01:00
|
|
|
if [ -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="armv7"
|
|
|
|
else
|
2021-11-08 21:58:32 +01:00
|
|
|
ynh_die --message "Unable to detect your achitecture, please open a bug describing \
|
2020-11-20 10:22:05 +01:00
|
|
|
your hardware and the result of the command \"uname -m\"." 1
|
2020-11-20 10:40:14 +01:00
|
|
|
fi
|
|
|
|
echo $architecture
|
2020-11-20 10:09:41 +01:00
|
|
|
}
|
|
|
|
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
|
|
|
# DEFINE ALL COMMON FONCTIONS
|
|
|
|
#=================================================
|
2021-11-08 21:48:50 +01:00
|
|
|
|