From c5e4bab85854476016b385ac80d962d1fcab9133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20Limkj=C3=A6r?= Date: Wed, 13 Dec 2017 22:00:14 +0100 Subject: [PATCH 1/3] Fix pyenv install on Solaris / Illumos pyenv install crashes on Solaris with an empty log file. Adding support for the proper Solaris getconf call in num_cpu_cores fixed it. Tested and working under OmniOS CE r151024. --- plugins/python-build/bin/python-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index f47c1e89..f89474b8 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -156,7 +156,7 @@ num_cpu_cores() { num="$(sysctl -n hw.ncpu 2>/dev/null || true)" ;; * ) - num="$({ getconf _NPROCESSORS_ONLN || + num="$({ getconf _NPROCESSORS_ONLN || getconf NPROCESSORS_ONLN || grep -c ^processor /proc/cpuinfo; } 2>/dev/null)" num="${num#0}" ;; From 5149c5316564bc95b18c8081f532aea3c934952c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20Limkj=C3=A6r?= Date: Thu, 14 Dec 2017 22:17:34 +0100 Subject: [PATCH 2/3] Add SunOS case statement to num_cpu_cores --- plugins/python-build/bin/python-build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index f89474b8..82b2c498 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -155,8 +155,11 @@ num_cpu_cores() { Darwin | *BSD ) num="$(sysctl -n hw.ncpu 2>/dev/null || true)" ;; + SunOS ) + num="$(getconf NPROCESSORS_ONLN 2>/dev/null)" + ;; * ) - num="$({ getconf _NPROCESSORS_ONLN || getconf NPROCESSORS_ONLN || + num="$({ getconf _NPROCESSORS_ONLN || grep -c ^processor /proc/cpuinfo; } 2>/dev/null)" num="${num#0}" ;; From dc145fa5a22b54da2bd6a68f45d0b1c45b7d471f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20Limkj=C3=A6r?= Date: Fri, 15 Dec 2017 09:19:15 +0100 Subject: [PATCH 3/3] Added true fallback to num_cpu_cores SunOS case --- plugins/python-build/bin/python-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 82b2c498..449c63e1 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -156,7 +156,7 @@ num_cpu_cores() { num="$(sysctl -n hw.ncpu 2>/dev/null || true)" ;; SunOS ) - num="$(getconf NPROCESSORS_ONLN 2>/dev/null)" + num="$(getconf NPROCESSORS_ONLN 2>/dev/null || true)" ;; * ) num="$({ getconf _NPROCESSORS_ONLN ||