support platforms which does not have shasum command #171

Merged
merged 1 commit into from Dec 5, 2012

Conversation

Projects
None yet
10 participants
@cou929
Contributor

cou929 commented Nov 23, 2012

Use sha1sum command if there is no shasum command.

Such like CentOS, for example, there are platforms which doesn't have 'shasum' command. On the such platform, we can install nothing because cannot calculate checksum. Like below:

    $ nvm install v0.9.1
    ######################################################################## 100.0%
    nvm:1: command not found: shasum
    Checksums do not match.
    Binary download failed, trying source.
    Additional options while compiling:
    ######################################################################## 100.0%
    nvm:1: command not found: shasum
    Checksums do not match.
    nvm: install v0.9.1 failed!
support platforms which does not have shasum command
use sha1sum command if there is no shasum command

creationix added a commit that referenced this pull request Dec 5, 2012

Merge pull request #171 from cou929/support_sha1sum_command
support platforms which does not have shasum command

@creationix creationix merged commit 68f7dc9 into creationix:master Dec 5, 2012

@kirbysayshi

This comment has been minimized.

Show comment Hide comment
@kirbysayshi

kirbysayshi Dec 5, 2012

I realize this issue is closed, but I just grabbed master on OSX and cannot install any remote versions of node. I'm receiving basically the same output:

RadioFreePro:bin drew$ nvm install v0.8.15
######################################################################## 100.0%
bash: sha1sum: command not found
Checksums do not match.
Binary download failed, trying source.
Additional options while compiling: 
######################################################################## 100.0%
bash: sha1sum: command not found
Checksums do not match.
nvm: install v0.8.15 failed!

My knowledge of bash is limited, but doesn't directing which shasum to /dev/null defeat the purpose of the if?

If I change it to be similar to the curl check:

if [ ! `which shasum` ]; then
  shasum='sha1sum'
fi

then I'm able to install again. If this sounds alright, I can make a pull request.

I realize this issue is closed, but I just grabbed master on OSX and cannot install any remote versions of node. I'm receiving basically the same output:

RadioFreePro:bin drew$ nvm install v0.8.15
######################################################################## 100.0%
bash: sha1sum: command not found
Checksums do not match.
Binary download failed, trying source.
Additional options while compiling: 
######################################################################## 100.0%
bash: sha1sum: command not found
Checksums do not match.
nvm: install v0.8.15 failed!

My knowledge of bash is limited, but doesn't directing which shasum to /dev/null defeat the purpose of the if?

If I change it to be similar to the curl check:

if [ ! `which shasum` ]; then
  shasum='sha1sum'
fi

then I'm able to install again. If this sounds alright, I can make a pull request.

@cou929

This comment has been minimized.

Show comment Hide comment
@cou929

cou929 Dec 5, 2012

Contributor

I think kirbysayshi's change is right. The condition if [ !which shasum 2> /dev/null]; of my patch will be always true. I'm sorry for my wrong code.

Contributor

cou929 commented Dec 5, 2012

I think kirbysayshi's change is right. The condition if [ !which shasum 2> /dev/null]; of my patch will be always true. I'm sorry for my wrong code.

@ofauno

This comment has been minimized.

Show comment Hide comment
@ofauno

ofauno Dec 5, 2012

confirmed, thanks.

ofauno commented Dec 5, 2012

confirmed, thanks.

@sdepold

This comment has been minimized.

Show comment Hide comment
@sdepold

sdepold Dec 5, 2012

i confirm that it's broken

sdepold commented Dec 5, 2012

i confirm that it's broken

@ValeriiVasin

This comment has been minimized.

Show comment Hide comment
@ValeriiVasin

ValeriiVasin Dec 6, 2012

it's broken. OSX Lion 10.7.3. FYI.

it's broken. OSX Lion 10.7.3. FYI.

@hanyee

This comment has been minimized.

Show comment Hide comment
@hanyee

hanyee Dec 7, 2012

sha1sum: command not found

OSX 10.8.2

hanyee commented Dec 7, 2012

sha1sum: command not found

OSX 10.8.2

@sdepold

This comment has been minimized.

Show comment Hide comment
@sdepold

sdepold Dec 7, 2012

The suggested patch fixes the issue btw!

Am 07.12.2012 um 06:55 schrieb JZ notifications@github.com:

sha1sum: command not found


Reply to this email directly or view it on
GitHubhttps://github.com/creationix/nvm/pull/171#issuecomment-11119839.

sdepold commented Dec 7, 2012

The suggested patch fixes the issue btw!

Am 07.12.2012 um 06:55 schrieb JZ notifications@github.com:

sha1sum: command not found


Reply to this email directly or view it on
GitHubhttps://github.com/creationix/nvm/pull/171#issuecomment-11119839.

@rngadam

This comment has been minimized.

Show comment Hide comment
@rngadam

rngadam Aug 30, 2013

Same issue for Centos 6.4:

$ which shasum
/usr/bin/which: no shasum in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/rngadam/bin)
$ which sha1sum
/usr/bin/sha1sum

rngadam commented Aug 30, 2013

Same issue for Centos 6.4:

$ which shasum
/usr/bin/which: no shasum in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/rngadam/bin)
$ which sha1sum
/usr/bin/sha1sum
@ljharb

This comment has been minimized.

Show comment Hide comment
@ljharb

ljharb Aug 30, 2013

Collaborator

@kirbysayshi master currently has if [ -z "\which curl" ] - if your change would work better, please do make a pull request.

Collaborator

ljharb commented Aug 30, 2013

@kirbysayshi master currently has if [ -z "\which curl" ] - if your change would work better, please do make a pull request.

@cbou

This comment has been minimized.

Show comment Hide comment
@cbou

cbou Nov 27, 2013

For OSX user:

just add alias sha1sum='shashum' to your ~/.profile

This should also work on linux but with the file ~/.bashrc

cbou commented Nov 27, 2013

For OSX user:

just add alias sha1sum='shashum' to your ~/.profile

This should also work on linux but with the file ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment