Changeset 8922c8b in rtems-source-builder
- Timestamp:
- 07/08/19 12:44:02 (5 years ago)
- Branches:
- 5, master
- Children:
- 8db33fb
- Parents:
- c799e04
- git-author:
- Chris Johns <chrisj@…> (07/08/19 12:44:02)
- git-committer:
- Chris Johns <chrisj@…> (07/21/19 11:09:34)
- Location:
- source-builder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source-builder/config/gdb-common-1.cfg
rc799e04 r8922c8b 109 109 %endif 110 110 %if %{gdb-python-config} != %{nil} 111 %define gdb-python-config-libs -l '%(%{gdb-python-config} --ldflags)' 112 %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} %{gdb-python-config-libs}) 111 %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*python.*")) print "lib"substr($i,3)"*";}' 112 %define gdb-python-config-libs %(%{gdb-python-config} --ldflags | %{gdb-python-lib-filter}) 113 %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-config-libs}) 113 114 %else 114 115 %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib}) -
source-builder/sb/config.py
rc799e04 r8922c8b 50 50 51 51 def _check_bool(value): 52 istrue = None 52 53 if value.isdigit(): 53 54 if int(value) == 0: … … 56 57 istrue = True 57 58 else: 58 istrue = None 59 if type(value) is str and len(value) == 2 and value[0] == '!': 60 istrue = _check_bool(value[1]) 61 if type(istrue) is bool: 62 istrue = not istrue 59 63 return istrue 60 64 … … 417 421 418 422 def _shell(self, line): 419 sl = self.sf.findall(line) 420 if len(sl): 421 e = execute.capture_execution() 422 for s in sl: 423 # 424 # Parse the line and handle nesting '()' pairs. 425 # 426 def _exec(shell_macro): 427 output = '' 428 if len(shell_macro) > 3: 429 e = execute.capture_execution() 423 430 if options.host_windows: 424 cmd = '%s -c "%s"' % (self.macros.expand('%{__sh}'), s [2:-1])425 else: 426 cmd = s [2:-1]431 cmd = '%s -c "%s"' % (self.macros.expand('%{__sh}'), shell_macro[2:-1]) 432 else: 433 cmd = shell_macro[2:-1] 427 434 exit_code, proc, output = e.shell(cmd) 428 435 log.trace('shell-output: %d %s' % (exit_code, output)) 429 if exit_code == 0: 430 line = line.replace(s, output) 431 else: 432 raise error.general('shell macro failed: %s:%d: %s' % (s, exit_code, output)) 436 if exit_code != 0: 437 raise error.general('shell macro failed: %s: %d: %s' % (cmd, 438 exit_code, 439 output)) 440 return output 441 442 updating = True 443 while updating: 444 updating = False 445 pos = line.find('%(') 446 if pos >= 0: 447 braces = 0 448 for p in range(pos + 2, len(line)): 449 if line[p] == '(': 450 braces += 1 451 elif line[p] == ')': 452 if braces > 0: 453 braces -= 1 454 else: 455 line = line[:pos] + _exec(line[pos:p + 1]) + line[p + 1:] 456 updating = True 457 break 433 458 return line 434 459
Note: See TracChangeset
for help on using the changeset viewer.