Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support platforms which does not have shasum command #171

Merged
merged 1 commit into from
Dec 5, 2012

Conversation

cou929
Copy link
Contributor

@cou929 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!

use sha1sum command if there is no shasum command
creationix added a commit that referenced this pull request Dec 5, 2012
support platforms which does not have shasum command
@creationix creationix merged commit 68f7dc9 into nvm-sh:master Dec 5, 2012
@kirbysayshi
Copy link

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
Copy link
Contributor Author

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.

@ph4un00b
Copy link

ph4un00b commented Dec 5, 2012

confirmed, thanks.

@sdepold
Copy link

sdepold commented Dec 5, 2012

i confirm that it's broken

@ValeriiVasin
Copy link

it's broken. OSX Lion 10.7.3. FYI.

@hanyee
Copy link

hanyee commented Dec 7, 2012

sha1sum: command not found

OSX 10.8.2

@sdepold
Copy link

sdepold commented Dec 7, 2012

The suggested patch fixes the issue btw!

Am 07.12.2012 um 06:55 schrieb JZ [email protected]:

sha1sum: command not found


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

@rngadam
Copy link

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
Copy link
Member

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
Copy link

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

ljharb added a commit that referenced this pull request Nov 29, 2013
@ljharb ljharb added installing node: checksums This relates to checksum checking of downloaded node archives. shell alias clobbering Anything dealing with users shadowing builtins with aliases or functions. and removed installing node: checksums This relates to checksum checking of downloaded node archives. labels Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node: checksums This relates to checksum checking of downloaded node archives. shell alias clobbering Anything dealing with users shadowing builtins with aliases or functions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants