summaryrefslogtreecommitdiff
path: root/devel/ice/files/patch-scripts-TestUtil.py
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2012-03-24 15:57:39 +0000
committerMartin Wilke <miwi@FreeBSD.org>2012-03-24 15:57:39 +0000
commitccecfeab22539d9ad1268f4eaf3383ce380b7ae0 (patch)
tree3770ac1ea6c0cac0b96bda09ec58fe0bd6565b4b /devel/ice/files/patch-scripts-TestUtil.py
parentFix formatting so that "make tidy" passes (diff)
- Fix build with gcc 4.7
- Add support for clang PR: 165702 Submitted by: Michael Gmelin <freebsd@grem.de> (maintainer) Feature safe: yes
Notes
Notes: svn path=/head/; revision=293741
Diffstat (limited to 'devel/ice/files/patch-scripts-TestUtil.py')
-rw-r--r--devel/ice/files/patch-scripts-TestUtil.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/devel/ice/files/patch-scripts-TestUtil.py b/devel/ice/files/patch-scripts-TestUtil.py
new file mode 100644
index 000000000000..093ba2d51151
--- /dev/null
+++ b/devel/ice/files/patch-scripts-TestUtil.py
@@ -0,0 +1,44 @@
+--- scripts.orig/TestUtil.py 2011-06-15 21:44:00.000000000 +0200
++++ scripts/TestUtil.py 2012-03-04 20:14:53.000000000 +0100
+@@ -74,6 +74,25 @@
+ def isLinux():
+ return sys.platform.startswith("linux")
+
++def isFreeBSD():
++ return sys.platform.startswith("freebsd")
++
++def sysctl(key):
++ p = subprocess.Popen("sysctl "+key, shell=1, stdout=subprocess.PIPE)
++ try:
++ result = p.communicate()[0].strip().split()[1]
++ except IndexError:
++ return 0
++ if sys.version_info >= (3,):
++ result = str(result, sys.stdout.encoding)
++ try:
++ return int(result)
++ except ValueError:
++ return result
++
++def isFreeBSDJail():
++ return isFreeBSD() and sysctl("security.jail.jailed")
++
+ def getCppCompiler():
+ compiler = ""
+ if os.environ.get("CPP_COMPILER", "") != "":
+@@ -1590,7 +1609,15 @@
+ if isDarwin() and "nodarwin" in config:
+ print "%s*** test not supported under Darwin%s" % (prefix, suffix)
+ continue
++
++ if isFreeBSD() and "nofreebsd" in config:
++ print "%s*** test not supported under FreeBSD%s" % (prefix, suffix)
++ continue
+
++ if isFreeBSDJail() and "nofreebsdjail" in config:
++ print "%s*** test not supported within a FreeBSD Jail%s" % (prefix, suffix)
++ continue
++
+ if not isWin32() and "win32only" in config:
+ print "%s*** test only supported under Win32%s" % (prefix, suffix)
+ continue