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
fi
function_check select_go_version
select_go_version
apt-get -y install golang mercurial
apt-get -y install mercurial
if [ ! -f ~/.bashrc ]; then
touch ~/.bashrc
fi

View File

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

View File

@ -28,7 +28,7 @@
# 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/>.
VARIANTS='mesh'
VARIANTS=''
IPFS_GO_REPO_BASE="github.com/ipfs/go-ipfs"
IPFS_GO_REPO="https://${IPFS_GO_REPO_BASE}"
@ -54,9 +54,6 @@ function upgrade_ipfs_go {
return
fi
function_check select_go_version
select_go_version
function_check set_repo_commit
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
return
fi
function_check select_go_version
select_go_version
systemctl stop ipfs
systemctl disable ipfs
systemctl daemon-reload
@ -398,14 +393,24 @@ function mesh_install_ipfs_go {
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
IPFS_ARCH=386
fi
if [[ $ARCHITECTURE == *"amd64" ]]; then
if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
IPFS_ARCH=amd64
fi
if [[ $ARCHITECTURE == *"arm"* ]]; then
IPFS_ARCH=arm
fi
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
IPFS_FILE=go-ipfs_v${IPFS_GO_VERSION}_linux-${IPFS_ARCH}.tar.gz
@ -450,9 +455,6 @@ function install_ipfs_go {
return
fi
function_check select_go_version
select_go_version
apt-get -y install golang libpam0g-dev fuse
if [ ! -d /home/git ]; then

View File

@ -141,14 +141,24 @@ function mesh_upgrade_golang {
if [[ $ARCHITECTURE == *"386" || $ARCHITECTURE == *"686" ]]; then
GOARCH=386
fi
if [[ $ARCHITECTURE == *"amd64" ]]; then
if [[ $ARCHITECTURE == *"amd64" || $ARCHITECTURE == "x86_64" ]]; then
GOARCH=amd64
fi
if [[ $ARCHITECTURE == *"arm"* ]]; then
GOARCH=armv6l
fi
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
GO_SOURCE=https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GOARCH}.tar.gz