summaryrefslogtreecommitdiffstats
path: root/waftools/detections/devices.py
blob: 42c4c2817154196e0fb938ec83a815514478e1b9 (plain)
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
__cdrom_devices_map__ = {
    'win32':   'D:',
    'cygwin':  'D:',
    'darwin':  '/dev/disk1',
    'freebsd': '/dev/cd0',
    'openbsd': '/dev/rcd0c',
    'linux':   '/dev/sr0',
    'default': '/dev/cdrom'
}

__dvd_devices_map__ = {
    'win32':   'D:',
    'cygwin':  'D:',
    'darwin':  '/dev/rdiskN',
    'freebsd': '/dev/cd0',
    'openbsd': '/dev/rcd0c',
    'linux':   '/dev/sr0',
    'default': '/dev/dvd'
}

def __default_cdrom_device__(ctx):
    default = __cdrom_devices_map__['default']
    return __cdrom_devices_map__.get(ctx.env.DEST_OS, default)

def __default_dvd_device__(ctx):
    default = __dvd_devices_map__['default']
    return __dvd_devices_map__.get(ctx.env.DEST_OS, default)

def configure(ctx):
    ctx.define('DEFAULT_DVD_DEVICE', __default_dvd_device__(ctx))
    ctx.define('DEFAULT_CDROM_DEVICE', __default_cdrom_device__(ctx))