1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00
This commit is contained in:
ericgaspar 2020-11-20 10:09:41 +01:00
parent 707d9f796b
commit 715e6ee32b
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 34 additions and 2 deletions

View file

@ -10,16 +10,47 @@ DATA_PATH="$DATADIR/data"
# Detect the system architecture to download the right tarball
# NOTE: `uname -m` is more accurate and universal than `arch`
# See https://en.wikipedia.org/wiki/Uname
ynh_detect_arch(){
local architecture
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="arm"
architecture="armv7"
else
ynh_die "Unable to detect your achitecture, please open a bug describing \
your hardware and the result of the command \"uname -m\"." 1
fi
}
# 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 86)" ]; then
# architecture="i386"
# 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"
# elif [ -n "$(uname -m | grep armv5)" ]; then
# architecture="armv5"
# else
# architecture="unknown"
# fi
# echo $architecture
# }
#=================================================
# DEFINE ALL COMMON FONCTIONS

View file

@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
architecture=$(ynh_detect_arch)
app=$YNH_APP_INSTANCE_NAME
@ -86,7 +87,7 @@ ynh_script_progression --message="Setting up source files..." --weight=3
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path $architecture
ynh_setup_source --dest_dir=$final_path --source_id="$architecture"
#=================================================
# STANDARD MODIFICATIONS