mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
Detect arch with uname, inspired by getcaddy.com
This commit is contained in:
parent
5f29a8f6a1
commit
b30ec6b691
2 changed files with 14 additions and 12 deletions
|
@ -47,7 +47,7 @@ Gogs v0.9.71
|
||||||
|
|
||||||
- [YunoHost forum thread](https://forum.yunohost.org/t/gogs-package-an-awesome-github-alternative/1127)
|
- [YunoHost forum thread](https://forum.yunohost.org/t/gogs-package-an-awesome-github-alternative/1127)
|
||||||
|
|
||||||
Architecture: this package is compatible with amd64, i386 and arm, the package will try to detect it with the command arch and fail if it can't find it. If that happen please open an issue describing your hardware and the result of the command `arch`.
|
Architecture: this package is compatible with amd64, i386 and arm, the package will try to detect it with the command uname -m and fail if it can't find it. If that happen please open an issue describing your hardware and the result of the command `uname -m`.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
Gogs is published under MIT License
|
Gogs is published under MIT License
|
||||||
|
|
|
@ -8,17 +8,19 @@ APPNAME="gogs"
|
||||||
VERSION="0.9.71"
|
VERSION="0.9.71"
|
||||||
|
|
||||||
# Detect the system architecture to download the right tarball
|
# Detect the system architecture to download the right tarball
|
||||||
case $(arch) in
|
# NOTE: `uname -m` is more accurate and universal than `arch`
|
||||||
x86_64) ARCHITECTURE="amd64"
|
# See https://en.wikipedia.org/wiki/Uname
|
||||||
;;
|
if [ -n "$(uname -m | grep 64)" ]; then
|
||||||
i386|i686) ARCHITECTURE="386"
|
ARCHITECTURE="amd64"
|
||||||
;;
|
elif [ -n "$(uname -m | grep 86)" ]; then
|
||||||
armhf|armel|armv7l) ARCHITECTURE="arm"
|
ARCHITECTURE="386"
|
||||||
;;
|
elif [ -n "$(uname -m | grep arm)" ]; then
|
||||||
*) echo 'Unable to detect your achitecture, please open a bug describing \
|
ARCHITECTURE="arm"
|
||||||
your hardware and the result of the command "arch".' && exit 1
|
else
|
||||||
;;
|
echo 'Unable to detect your achitecture, please open a bug describing \
|
||||||
esac
|
your hardware and the result of the command "uname -m".'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Remote URL to fetch Gogs tarball
|
# Remote URL to fetch Gogs tarball
|
||||||
GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/linux_${ARCHITECTURE}.zip"
|
GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/linux_${ARCHITECTURE}.zip"
|
||||||
|
|
Loading…
Reference in a new issue