aboutsummaryrefslogtreecommitdiffstats
path: root/devel/ice/files/patch-scripts-TestUtil.py
blob: 2b992d5512a97018c1974c561e9cf442d484d1dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- scripts.orig/TestUtil.py    2013-03-11 15:19:47.000000000 +0000
+++ scripts/TestUtil.py 2013-05-21 00:29:37.903194948 +0000
@@ -84,6 +84,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", "") != "":
@@ -1846,6 +1865,14 @@
                 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
0'>2013-09-171-3/+3 * - textproc/p5-KinoSearch was removed (r318336) and superseded byaz2013-09-021-1/+1 * - switch simple inline replacement from perl to sedaz2013-07-261-2/+2 * - adopt optionsNGjgh2013-03-212-146/+156 * Remove p5-Xango support as it is expired and will soon be removed.eadler2012-09-011-9/+0 * - Remove SITE_PERL from *_DEPENDSaz2012-07-011-103/+103 * At the moment 1385 ports use BUILD_DEPENDS= ${RUN_DEPENDS} and 450eadler2012-01-221-1/+1