File: __init__.py

package info (click to toggle)
xen 4.4.1-9
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 35,032 kB
  • sloc: ansic: 407,163; python: 53,506; sh: 9,487; asm: 6,944; makefile: 5,716; ml: 4,138; perl: 2,990; lex: 311; pascal: 252; yacc: 43; xml: 35
file content (19 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def _setup():
    import os.path, sys
    version = None
    rules = os.path.join(__path__[0], "../../../rules.defs")
    f = file(rules)
    for l in f:
        l = l.strip().split()
        if l[0] == 'KERNELVERSION':
            version = l[-1]
    f.close()
    if version is None:
        raise RuntimeError("Can't find KERNELVERSION setting")
    global support
    support = '/usr/src/linux-support-%s' % version
    if not os.path.exists(support):
        raise RuntimeError("Can't find %s, please install the linux-support-%s package" % (support, version))
    sys.path.append('%s/lib/python' % support)

_setup()