mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
Fix nvm on SmartOS setups using 64 bits pkgsrc repository
On SmartOS setups using 64 bits pkgsrc repositories, `nvm_get_arch` would not handle pkg_info's output properly. This would result in nvm not being to install any node binary when running on SmartOS setups using a 64 bits pkgsrc repository. This change fixes this problem, and fixes the tests suite on similar setups.
This commit is contained in:
parent
f51b1bf8ae
commit
a32b914bab
2
nvm.sh
2
nvm.sh
@ -1235,6 +1235,8 @@ nvm_get_arch() {
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
HOST_ARCH=$(isainfo -n)
|
||||
else
|
||||
HOST_ARCH=$(echo "$HOST_ARCH" | tail -1)
|
||||
fi
|
||||
else
|
||||
HOST_ARCH="$(command uname -m)"
|
||||
|
@ -32,6 +32,8 @@ setup_mock_arch() {
|
||||
ln -sf "${MOCKS_DIR}/isainfo_${ARCH}" ./isainfo
|
||||
if [ "_$OPT" != "_no_pkg_info" ]; then
|
||||
ln -sf "${MOCKS_DIR}/pkg_info_${ARCH}" ./pkg_info
|
||||
else
|
||||
ln -sf "${MOCKS_DIR}/pkg_info_fail" ./pkg_info
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1 +1,4 @@
|
||||
# On SmartOS 64bits setups, pkg_info outputs _both_ i386 and x86_64
|
||||
# architectures as architectures supported by pkg_install.
|
||||
echo "i386"
|
||||
echo "x86_64"
|
||||
|
1
test/mocks/pkg_info_fail
Executable file
1
test/mocks/pkg_info_fail
Executable file
@ -0,0 +1 @@
|
||||
exit 1
|
Loading…
Reference in New Issue
Block a user