Changes in tools/ew.py [dabaa83:01552e3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/ew.py
rdabaa83 r01552e3 33 33 """ 34 34 35 import inspect 35 36 import os 37 import platform 38 import re 39 import subprocess 36 40 import sys 37 import subprocess38 import autotool39 import platform40 41 import thread 41 42 import time 42 43 43 44 overrides = {} 45 46 CONFIG = 'Makefile.config' 47 48 TOOLS_DIR = os.path.dirname(inspect.getabsfile(inspect.currentframe())) 49 50 def read_config(): 51 "Read HelenOS build configuration" 52 53 inf = open(CONFIG, 'r') 54 config = {} 55 56 for line in inf: 57 res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line) 58 if (res): 59 config[res.group(1)] = res.group(2) 60 61 inf.close() 62 return config 44 63 45 64 def is_override(str): … … 57 76 58 77 def termemu_detect(): 59 for termemu in ['xfce4-terminal', 'xterm']: 78 emus = ['gnome-terminal', 'xfce4-terminal', 'xterm'] 79 for termemu in emus: 60 80 try: 61 81 subprocess.check_output('which ' + termemu, shell = True) … … 64 84 pass 65 85 86 print('Could not find any of the terminal emulators %s.'%(emus)) 87 sys.exit(1) 88 66 89 def run_in_console(cmd, title): 67 ecmd = cmd.replace('"', '\\"') 68 cmdline = termemu_detect() + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"' 90 temu = termemu_detect() 91 if temu == 'gnome-terminal': 92 cmdline = temu + ' -- ' + cmd 93 else: 94 ecmd = cmd.replace('"', '\\"') 95 cmdline = temu + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"' 96 69 97 print(cmdline) 70 98 if not is_override('dryrun'): … … 155 183 def hdisk_mk(): 156 184 if not os.path.exists('hdisk.img'): 157 subprocess.call( 'tools/mkfat.py 1048576 uspace/dist/data hdisk.img', shell = True)185 subprocess.call(TOOLS_DIR + '/mkfat.py 1048576 dist/data hdisk.img', shell = True) 158 186 159 187 def qemu_bd_options(): … … 289 317 290 318 def ski_run(platform, machine, processor): 291 run_in_console('ski -i tools/conf/ski.conf', 'HelenOS/ia64 on ski')319 run_in_console('ski -i ' + TOOLS_DIR + '/conf/ski.conf', 'HelenOS/ia64 on ski') 292 320 293 321 def msim_run(platform, machine, processor): 294 322 hdisk_mk() 295 run_in_console('msim -c tools/conf/msim.conf', 'HelenOS/mips32 on msim')323 run_in_console('msim -c ' + TOOLS_DIR + '/conf/msim.conf', 'HelenOS/mips32 on msim') 296 324 297 325 def spike_run(platform, machine, processor): … … 486 514 exit() 487 515 488 config = {} 489 autotool.read_config(autotool.CONFIG, config) 516 config = read_config() 490 517 491 518 if 'PLATFORM' in config.keys():
Note:
See TracChangeset
for help on using the changeset viewer.