mirror of
https://github.com/YunoHost-Apps/gotosocial_ynh.git
synced 2024-09-03 19:16:06 +02:00
Merge pull request #6 from YunoHost-Apps/detect_arch_arm
Detect arch arm
This commit is contained in:
commit
1de7eedc48
4 changed files with 25 additions and 3 deletions
|
@ -11,6 +11,26 @@ pkg_dependencies="postgresql postgresql-contrib"
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
# custom function to detect armv6 and armv7
|
||||||
|
# ($YNH_ARCH returns armhf for both...)
|
||||||
|
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 armv6)" ]; then
|
||||||
|
architecture="armv6"
|
||||||
|
elif [ -n "$(uname -m | grep armv7)" ]; then
|
||||||
|
architecture="armv7"
|
||||||
|
else
|
||||||
|
architecture="unknown"
|
||||||
|
fi
|
||||||
|
echo $architecture
|
||||||
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -140,7 +140,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
### downloaded from an upstream source, like a git repository.
|
### downloaded from an upstream source, like a git repository.
|
||||||
### `ynh_setup_source` use the file conf/app.src
|
### `ynh_setup_source` use the file conf/app.src
|
||||||
|
|
||||||
architecture=$YNH_ARCH
|
# detect_arch comes from _common.sh / personnal helpers
|
||||||
|
architecture=$(detect_arch)
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture
|
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture
|
||||||
|
|
|
@ -83,8 +83,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
architecture=$YNH_ARCH
|
# detect_arch comes from _common.sh / personnal helpers
|
||||||
|
architecture=$(detect_arch)
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture --keep="config.yaml"
|
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture --keep="config.yaml"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue