Architecture detection

This commit is contained in:
Bob Mottram 2016-09-29 10:16:52 +01:00
parent 5869c445db
commit 48466cebd2
4 changed files with 28 additions and 21 deletions

View File

@ -483,10 +483,7 @@ function install_cjdns_tools {
install_cjdns install_cjdns
fi fi
function_check select_go_version apt-get -y install mercurial
select_go_version
apt-get -y install golang mercurial
if [ ! -f ~/.bashrc ]; then if [ ! -f ~/.bashrc ]; then
touch ~/.bashrc touch ~/.bashrc
fi fi

View File

@ -47,7 +47,7 @@ function gogs_parameters {
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
CURR_ARCH=386 CURR_ARCH=386
fi fi
if [[ $ARCHITECTURE == *"amd64" ]]; then if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
CURR_ARCH=amd64 CURR_ARCH=amd64
fi fi
if [[ $ARCHITECTURE == *"arm"* ]]; then if [[ $ARCHITECTURE == *"arm"* ]]; then
@ -59,7 +59,7 @@ function gogs_parameters {
if [[ $ARCHITECTURE == "arm"* ]]; then if [[ $ARCHITECTURE == "arm"* ]]; then
CURR_ARCH=arm CURR_ARCH=arm
fi fi
if [[ $ARCHITECTURE == "amd"* ]]; then if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
CURR_ARCH=amd64 CURR_ARCH=amd64
fi fi
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
@ -317,8 +317,6 @@ function remove_gogs {
if ! grep -Fxq "install_gogs" $COMPLETION_FILE; then if ! grep -Fxq "install_gogs" $COMPLETION_FILE; then
return return
fi fi
function_check select_go_version
select_go_version
systemctl stop gogs systemctl stop gogs
systemctl disable gogs systemctl disable gogs

View File

@ -28,7 +28,7 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
VARIANTS='mesh' VARIANTS=''
IPFS_GO_REPO_BASE="github.com/ipfs/go-ipfs" IPFS_GO_REPO_BASE="github.com/ipfs/go-ipfs"
IPFS_GO_REPO="https://${IPFS_GO_REPO_BASE}" IPFS_GO_REPO="https://${IPFS_GO_REPO_BASE}"
@ -54,9 +54,6 @@ function upgrade_ipfs_go {
return return
fi fi
function_check select_go_version
select_go_version
function_check set_repo_commit function_check set_repo_commit
set_repo_commit $GOPATH/src/github.com/ipfs/go-ipfs "ipfs commit" "$IPFS_COMMIT" $IPFS_REPO set_repo_commit $GOPATH/src/github.com/ipfs/go-ipfs "ipfs commit" "$IPFS_COMMIT" $IPFS_REPO
} }
@ -153,8 +150,6 @@ function remove_ipfs_go {
if ! grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then if ! grep -Fxq "install_ipfs_go" $COMPLETION_FILE; then
return return
fi fi
function_check select_go_version
select_go_version
systemctl stop ipfs systemctl stop ipfs
systemctl disable ipfs systemctl disable ipfs
systemctl daemon-reload systemctl daemon-reload
@ -398,14 +393,24 @@ function mesh_install_ipfs_go {
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
IPFS_ARCH=386 IPFS_ARCH=386
fi fi
if [[ $ARCHITECTURE == *"amd64" ]]; then if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
IPFS_ARCH=amd64 IPFS_ARCH=amd64
fi fi
if [[ $ARCHITECTURE == *"arm"* ]]; then if [[ $ARCHITECTURE == *"arm"* ]]; then
IPFS_ARCH=arm IPFS_ARCH=arm
fi fi
if [ ! $IPFS_ARCH ]; then if [ ! $IPFS_ARCH ]; then
return echo $'No architecture specified'
ARCHITECTURE=$(uname -m)
if [[ $ARCHITECTURE == "arm"* ]]; then
IPFS_ARCH=arm
fi
if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
IPFS_ARCH=amd64
fi
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
IPFS_ARCH=386
fi
fi fi
IPFS_FILE=go-ipfs_v${IPFS_GO_VERSION}_linux-${IPFS_ARCH}.tar.gz IPFS_FILE=go-ipfs_v${IPFS_GO_VERSION}_linux-${IPFS_ARCH}.tar.gz
@ -450,9 +455,6 @@ function install_ipfs_go {
return return
fi fi
function_check select_go_version
select_go_version
apt-get -y install golang libpam0g-dev fuse apt-get -y install golang libpam0g-dev fuse
if [ ! -d /home/git ]; then if [ ! -d /home/git ]; then

View File

@ -141,14 +141,24 @@ function mesh_upgrade_golang {
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
GOARCH=386 GOARCH=386
fi fi
if [[ $ARCHITECTURE == *"amd64" ]]; then if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
GOARCH=amd64 GOARCH=amd64
fi fi
if [[ $ARCHITECTURE == *"arm"* ]]; then if [[ $ARCHITECTURE == *"arm"* ]]; then
GOARCH=armv6l GOARCH=armv6l
fi fi
if [ ! $GOARCH ]; then if [ ! $GOARCH ]; then
return echo $'No architecture specified'
ARCHITECTURE=$(uname -m)
if [[ $ARCHITECTURE == "arm"* ]]; then
GOARCH=armv6l
fi
if [[ $ARCHITECTURE == "amd"* || $ARCHITECTURE == "x86_64" ]]; then
GOARCH=amd64
fi
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
GOARCH=386
fi
fi fi
GO_SOURCE=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz GO_SOURCE=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz