1
0
Fork 0
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:
OniriCorpe 2022-03-17 20:23:58 +01:00 committed by GitHub
commit 1de7eedc48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 3 deletions

View file

@ -11,6 +11,26 @@ pkg_dependencies="postgresql postgresql-contrib"
# 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
#=================================================

View file

@ -140,7 +140,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1
### downloaded from an upstream source, like a git repository.
### `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
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture

View file

@ -83,8 +83,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
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
ynh_setup_source --dest_dir="$final_path" --source_id=$architecture --keep="config.yaml"
fi