diff --git a/src/freedombone-app-ipfs b/src/freedombone-app-ipfs index ecf88245..0f6e4d58 100755 --- a/src/freedombone-app-ipfs +++ b/src/freedombone-app-ipfs @@ -30,7 +30,8 @@ VARIANTS='mesh' -IPFS_GO_REPO="https://github.com/ipfs/go-ipfs" +IPFS_GO_REPO_BASE="github.com/ipfs/go-ipfs" +IPFS_GO_REPO="https://${IPFS_GO_REPO_BASE}" IPFS_COMMIT='20b06a4cbce8884f5b194da6e98cb11f2c77f166' IPFS_PORT=4001 IPFS_NODE_VERSION='6.2.2' @@ -415,19 +416,23 @@ if grep -q 'GOPATH/bin' ~/.bashrc; then fi chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc -IPFS_GO_REPO2=$(echo "$IPFS_GO_REPO" | sed 's|https://||g') -go get -u ${IPFS_GO_REPO2}/cmd/ipfs +echo "go get -u ${IPFS_GO_REPO_BASE}/cmd/ipfs" +go get -u ${IPFS_GO_REPO_BASE}/cmd/ipfs if [ ! "$?" = "0" ]; then exit 8242 fi -if [ ! -d $GOPATH/src/$IPFS_GO_REPO2 ]; then +if [ ! -d $GOPATH/src/$IPFS_GO_REPO_BASE ]; then echo $'go get failed to get ipfs' exit 63923 fi -cd \$GOPATH/src/$IPFS_GO_REPO2 +cd \$GOPATH/src/$IPFS_GO_REPO_BASE git checkout $IPFS_COMMIT -b $IPFS_COMMIT +if [ ! "$?" = "0" ]; then + exit 735639 +fi + exit 0 EOF chroot ${rootdir} chmod +x /root/install_ipfs_go.sh @@ -512,19 +517,22 @@ function install_ipfs_go { fi chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc - IPFS_GO_REPO2=$(echo "$IPFS_GO_REPO" | sed 's|https://||g') - go get -u ${IPFS_GO_REPO2}/cmd/ipfs + go get -u ${IPFS_GO_REPO_BASE}/cmd/ipfs if [ ! "$?" = "0" ]; then exit 8242 fi - if [ ! -d $GOPATH/src/$IPFS_GO_REPO2 ]; then + if [ ! -d $GOPATH/src/$IPFS_GO_REPO_BASE ]; then echo $'go get failed to get ipfs' exit 63923 fi - cd $GOPATH/src/$IPFS_GO_REPO2 + cd $GOPATH/src/$IPFS_GO_REPO_BASE git checkout $IPFS_COMMIT -b $IPFS_COMMIT + if [ ! "$?" = "0" ]; then + exit 735639 + fi + if ! grep -q "ipfs commit" $COMPLETION_FILE; then echo "ipfs commit:$IPFS_COMMIT" >> $COMPLETION_FILE else