Merge pull request 'added support for arm64 in pleroma_ctl' (#630) from YokaiRick/akkoma:arm64-pleroma_ctl into develop

Reviewed-on: AkkomaGang/akkoma#630
This commit is contained in:
floatingghost 2023-11-02 11:03:22 +00:00
commit 3cca953c58

View file

@ -2,21 +2,28 @@
# XXX: This should be removed when elixir's releases get custom command support # XXX: This should be removed when elixir's releases get custom command support
detect_flavour() { detect_flavour() {
arch="amd64" machine_type=$(uname -m)
if getconf GNU_LIBC_VERSION >/dev/null; then if [ ${machine_type} = 'aarch64' ] ; then
libc_postfix="" arch='arm64'
elif [ "$(ldd 2>&1 | head -c 9)" = "musl libc" ]; then elif [ ${machine_type} = 'x86_64' ] ; then
libc_postfix="-musl" arch='amd64'
elif [ "$(find /lib/libc.musl* | wc -l)" ]; then if getconf GNU_LIBC_VERSION >/dev/null; then
libc_postfix="-musl" libc_postfix=""
else elif [ "$(ldd 2>&1 | head -c 9)" = "musl libc" ]; then
echo "Unsupported libc" >&2 libc_postfix="-musl"
exit 1 elif [ "$(find /lib/libc.musl* | wc -l)" ]; then
libc_postfix="-musl"
else
echo "Unsupported libc" >&2
exit 1
fi
else
echo "Could not detect your architecture please pass them via --flavour"
exit 1
fi fi
echo "$arch$libc_postfix" echo "$arch$libc_postfix"
} }
detect_branch() { detect_branch() {
version="$(cut -d' ' -f2 <"$RELEASE_ROOT"/releases/start_erl.data)" version="$(cut -d' ' -f2 <"$RELEASE_ROOT"/releases/start_erl.data)"
# Expected format: major.minor.patch_version(-number_of_commits_ahead_of_tag-gcommit_hash).branch # Expected format: major.minor.patch_version(-number_of_commits_ahead_of_tag-gcommit_hash).branch