Changeset 175ce0b in rtems-source-builder


Ignore:
Timestamp:
Mar 2, 2020, 3:45:29 AM (4 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, master
Children:
4295d3d
Parents:
5ec0913
git-author:
Chris Johns <chrisj@…> (03/02/20 03:45:29)
git-committer:
Chris Johns <chrisj@…> (03/03/20 00:18:05)
Message:

sb/config: Expanded nested shell commands

Updates #3893

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/config.py

    r5ec0913 r175ce0b  
    420420        return macros
    421421
    422     def _shell(self, line):
     422    def _shell(self, line, nesting = 0):
    423423        #
    424424        # Parse the line and handle nesting '()' pairs. If on Windows
     
    442442                                                                            output))
    443443            return output
     444
     445        if nesting > 200:
     446            raise error.general('shell macro failed: too many nesting levels')
    444447
    445448        updating = True
     
    456459                            braces -= 1
    457460                        else:
    458                             line = line[:pos] + _exec(line[pos:p + 1]) + line[p + 1:]
     461                            shell_cmd = '%(' + self._shell(line[pos + 2:p], nesting + 1) + ')'
     462                            line = line[:pos] + _exec(shell_cmd) + line[p + 1:]
    459463                            updating = True
    460464                            break
     465
    461466        return line
    462467
Note: See TracChangeset for help on using the changeset viewer.