Add MacOS support to no-dot-so test

This commit is contained in:
Jack Grigg 2018-06-05 22:32:13 +12:00
parent 12d3277171
commit c7e64754dc
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
1 changed files with 10 additions and 6 deletions

View File

@ -4,6 +4,7 @@
#
import argparse
from glob import glob
import os
import re
import subprocess
@ -79,11 +80,14 @@ def check_security_hardening():
return ret
def ensure_no_dot_so_in_depends():
arch_dir = os.path.join(
REPOROOT,
'depends',
'x86_64-unknown-linux-gnu',
)
depends_dir = os.path.join(REPOROOT, 'depends')
arch_dir = os.path.join(depends_dir, 'x86_64-unknown-linux-gnu')
if not os.path.isdir(arch_dir):
# Not Linux, try MacOS
arch_dirs = glob(os.path.join(depends_dir, 'x86_64-apple-darwin*'))
if arch_dirs:
# Just try the first one; there will only be on in CI
arch_dir = arch_dirs[0]
exit_code = 0
@ -97,7 +101,7 @@ def ensure_no_dot_so_in_depends():
exit_code = 1
else:
exit_code = 2
print "arch-specific build dir not present: {}".format(arch_dir)
print "arch-specific build dir not present"
print "Did you build the ./depends tree?"
print "Are you on a currently unsupported architecture?"