aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbn <dbn@FreeBSD.org>2014-11-14 01:34:15 +0800
committerdbn <dbn@FreeBSD.org>2014-11-14 01:34:15 +0800
commitba2e382c863e09cac10881be17a546f251bcb955 (patch)
tree75bb173bd9c594081f8103262c95b4a3b60347ba
parent0f09c52a2cd05b06b98b9a8b3c7536cf34d8242c (diff)
downloadfreebsd-ports-gnome-ba2e382c863e09cac10881be17a546f251bcb955.tar.gz
freebsd-ports-gnome-ba2e382c863e09cac10881be17a546f251bcb955.tar.zst
freebsd-ports-gnome-ba2e382c863e09cac10881be17a546f251bcb955.zip
Add missing patch from r372531.
-rw-r--r--lang/pypy/files/patch-rpython__config__support.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/lang/pypy/files/patch-rpython__config__support.py b/lang/pypy/files/patch-rpython__config__support.py
new file mode 100644
index 000000000000..5e212c0b645f
--- /dev/null
+++ b/lang/pypy/files/patch-rpython__config__support.py
@@ -0,0 +1,28 @@
+--- ./rpython/config/support.py~ 2013-12-16 12:34:17.000000000 +0200
++++ ./rpython/config/support.py 2013-12-16 12:33:52.000000000 +0200
+@@ -8,7 +8,9 @@
+ if os.environ.get('MAKEFLAGS'):
+ return 1 # don't override MAKEFLAGS. This will call 'make' without any '-j' option
+ if sys.platform == 'darwin':
+- return darwin_get_cpu_count()
++ return sysctl_get_cpu_count('/usr/sbin/sysctl')
++ elif sys.platform.startswith('freebsd'):
++ return sysctl_get_cpu_count('/sbin/sysctl')
+ elif not sys.platform.startswith('linux'):
+ return 1 # implement me
+ try:
+@@ -26,11 +28,10 @@
+ except:
+ return 1 # we really don't want to explode here, at worst we have 1
+
+-def darwin_get_cpu_count(cmd = "/usr/sbin/sysctl hw.ncpu"):
++def sysctl_get_cpu_count(cmd, name='hw.ncpu'):
+ try:
+- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
+- # 'hw.ncpu: 20'
+- count = proc.communicate()[0].rstrip()[8:]
++ proc = subprocess.Popen([cmd, '-n', name], stdout=subprocess.PIPE)
++ count = proc.communicate()[0]
+ return int(count)
+ except (OSError, ValueError):
+ return 1