Add basic functionnality to guess operating system

parent 02057b2e
......@@ -31,6 +31,7 @@ import setuptools
import shlex
import shutil
import subprocess
import sys
import tempfile
import zc.buildout
......@@ -41,6 +42,12 @@ ARCH_MAP = {
'x86_64': 'x86-64'
}
OS_MAP = {
'darwin': 'mac',
'linux2': 'linux'
#To be continued
}
def readElfAsDict(f):
"""Reads ELF information from file"""
......@@ -102,13 +109,17 @@ def guessworkdir(path):
return os.path.join(path, os.listdir(path)[0])
return path
def guessPlatform():
arch = uname()[-2]
target = ARCH_MAP.get(arch)
assert target, 'Unknown architecture'
return target
def guessOperatingSystem():
platform = sys.platform
target = OS_MAP.get(platform)
assert target, 'Unknown architecture'
return target
TRUE_LIST = ('y', 'on', 'yes', 'true', '1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment