mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-10-30 09:18:59 +08:00
Fix support for installing node on SmartOS
uname on SmartOS cannot be used to guess if 32 and/or 64 bits binaries are supported, and its output is different than other uname commands on other operating systems. This change uses pkg_info to determine what types of binaries pkgsrc would install. If pkg_info fails to run or is not present, this change falls back to using isainfo -n, which determines what the kernel supports. It allows users to install node binaries on Solaris derivatives. io.js can also be installed on Solaris derivatives starting with version v3.3.1.
This commit is contained in:
5
test/mocks/isainfo_amd64
Executable file
5
test/mocks/isainfo_amd64
Executable file
@@ -0,0 +1,5 @@
|
||||
if [ "_$1" = "_-n" ]; then
|
||||
echo "amd64"
|
||||
else
|
||||
echo "amd64 i386"
|
||||
fi
|
||||
5
test/mocks/isainfo_x86
Executable file
5
test/mocks/isainfo_x86
Executable file
@@ -0,0 +1,5 @@
|
||||
if [ "_$1" = "_-n" ]; then
|
||||
echo "i386"
|
||||
else
|
||||
echo "i386"
|
||||
fi
|
||||
1
test/mocks/pkg_info_amd64
Executable file
1
test/mocks/pkg_info_amd64
Executable file
@@ -0,0 +1 @@
|
||||
echo "x86_64"
|
||||
1
test/mocks/pkg_info_x86
Executable file
1
test/mocks/pkg_info_x86
Executable file
@@ -0,0 +1 @@
|
||||
echo "i386"
|
||||
5
test/mocks/uname_osx_amd64
Executable file
5
test/mocks/uname_osx_amd64
Executable file
@@ -0,0 +1,5 @@
|
||||
if [ "_$1" = "_-m" ]; then
|
||||
echo "x86_64"
|
||||
else
|
||||
echo "Darwin foo.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64"
|
||||
fi
|
||||
5
test/mocks/uname_osx_x86
Executable file
5
test/mocks/uname_osx_x86
Executable file
@@ -0,0 +1,5 @@
|
||||
if [ "_$1" = "_-m" ]; then
|
||||
echo "i386"
|
||||
else
|
||||
echo "Darwin foo.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_I386 i386"
|
||||
fi
|
||||
5
test/mocks/uname_smartos_amd64
Executable file
5
test/mocks/uname_smartos_amd64
Executable file
@@ -0,0 +1,5 @@
|
||||
if [ "_$1" = "_-m" ]; then
|
||||
echo "i86pc"
|
||||
else
|
||||
echo "SunOS dev 5.11 joyent_20150219T102159Z i86pc i386 i86pc Solaris"
|
||||
fi
|
||||
5
test/mocks/uname_smartos_x86
Executable file
5
test/mocks/uname_smartos_x86
Executable file
@@ -0,0 +1,5 @@
|
||||
if [ "_$1" = "_-m" ]; then
|
||||
echo "i86pc"
|
||||
else
|
||||
echo "SunOS dev 5.11 joyent_20150219T102159Z i86pc i386 i86pc Solaris"
|
||||
fi
|
||||
Reference in New Issue
Block a user