alouche / rodent

Manage Go Versions/Projects/Dependencies

Home Page:http://alouche.net/rodent/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bad substitution - error while install

kishorevaishnav opened this issue · comments

Sorry to open one more ticket, I didn't really tested well. #1 is fixed, but now some other errors.

09:19 $ rodent -h
Usage: rodent [command] [args]
       help        Display the help
       set         Set a version of Go
       install     Install a version of Go
       versions    Display installed/in-use version(s)
       uninstall   Uninstall a version of Go

       system      Maintenance routines
~/gothings/src/github.com/test_rodent 
09:19 $ rodent system -u
Already up-to-date.
rodent v0.1.2-8-g04062a4
~/gothings/src/github.com/test_rodent 
09:19 $ rodent install -l
Available versions:
 go1.4beta1
 go1.3.3
 go1.3.2
 go1.3.1
 go1.3rc2
 go1.3rc1
 go1.3
 go1.2.2
 go1.1.2
 go1.1.1
 go1.1beta1
 go1.1
 go1.0.3
 go1.0.2
 go1.0.1
 gogo1
~/gothings/src/github.com/test_rodent 
09:19 $ rodent install go1.2.2
/Users/kishore/rodent/functions/helpers: line 92: ${platform,,}: bad substitution
/Users/kishore/rodent/functions/helpers: line 92: ${platform,,}: bad substitution
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
/Users/kishore/rodent/functions/logging: line 4: ${msg^}: bad substitution
~/gothings/src/github.com/test_rodent 
09:19 $ rodent install go1.3
/Users/kishore/rodent/functions/helpers: line 92: ${platform,,}: bad substitution
/Users/kishore/rodent/functions/helpers: line 92: ${platform,,}: bad substitution
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
/Users/kishore/rodent/functions/logging: line 4: ${msg^}: bad substitution
~/gothings/src/github.com/test_rodent 
09:20 $ 

Hi,

Which version of bash are you running?

echo $BASH_VERSION
09:27 $ echo $BASH_VERSION
3.2.53(1)-release

Hi,

Sorry for the late reply. The subtitutions require Bash 4+. I will provide shortly a workaround to support version below 4.0.

I tested with bash 3.2.25(1)-release. Could you confirm on your side?

Its still not fixed. See the attached image
screen shot 2014-11-09 at 2 21 40 pm

I did a fork of the repository and tried to update the mktemp syntax and ended up resolving few things but I don't think I did right.
screen shot 2014-11-09 at 2 35 54 pm

Here is what I did kishorevaishnav@8e23ef8. I know the bad part is next time it will create problem as rodent1 is already available. I just tried but no success.

How about 03293dc ? I do not have an OSX installation at hand to test, so would appreciate if you could confirm the mktemp oddity on OSX.

I couldn't get it working using 03293dc ... here are the errors

~/gothings/src/test_rodent/rodent1 
20:45 $ rodent install go1.2.2
# Downloading golang source go1.2.2
error: the download failed, please retry later...
~/gothings/src/test_rodent/rodent1 
20:46 $ rodent install go1.1
# Downloading golang source go1.1
# Untarring binary to /Users/kishore/rodent/releases
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
libmach
misc/pprof
..
..
..
testing/iotest
testing/quick
# runtime/cgo
clang: warning: argument unused during compilation: '-pthread'
# runtime/cgo
clang: error: no such file or directory: 'libgcc.a'
error: compilation failed - installation aborted
20:56 $ rodent install go1.4beta1
# Downloading golang source go1.4beta1
# Untarring binary to /Users/kishore/rodent/releases
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
liblink
misc/pprof
..
..
..
net/rpc
net/rpc/jsonrpc


---
Installed Go for darwin/amd64 in /Users/kishore/rodent/releases/go1.4beta1
Installed commands in /Users/kishore/rodent/releases/go1.4beta1/bin
# Downloading binary distribution go1.4beta1.darwin-amd64-osx10.8.tar.gz
cp: directory /Users/kishore/rodent/releases/go1.4beta1/src/pkg/runtime does not exist
21:14 $ cat .rodentrc 
gover=go1.4beta1
~/gothings/src/test_rodent/rodent1 
21:14 $ go version
go version go1.3.1 darwin/amd64

Hi, this is because go1.4.beta1 was not properly setup and this is due because upstream merged pkg in src directly since 1.4. It was fixed in rodent but in commit c788cea. If you rodent system -u, it should work

Did you see my error with go1.1 also apart from go1.4beta1?
Also I tested with rodent system -u

I get the below output

You are not currently on a branch. Please specify which
branch you want to merge with. See git-pull(1) for details.

    git pull <remote> <branch>

error: failed to update rodent

Also can you tell me how to uninstall completely and reinstall again if I need to do that.

Did you clone rodent or did you download the tar and extract? For the error with go1.1, could you open a separate github issue?

I tried both. I did opened a new ticket for go1.1