diff --git a/shrinkwrap/utils/config.py b/shrinkwrap/utils/config.py index fbf673100c3d2802ae0a92f5a2e9de681fa37081..52246efeaa47749ca2b733d24912473742bbae1d 100644 --- a/shrinkwrap/utils/config.py +++ b/shrinkwrap/utils/config.py @@ -237,14 +237,14 @@ def _string_tokenize(string, escape=True): 'value'. If 'type' is 'literal', 'value' is the literal string. If 'type' is 'macro', 'value' is a dict defining 'type' and 'name'. """ - regex = '\$(?:' \ - '(?P\$)|' \ - '(?:\{' \ - '(?P[_a-zA-Z][_a-zA-Z0-9]*):' \ - '(?P[_a-zA-Z][_a-zA-Z0-9]*)?' \ - '\})|' \ - '(?P)' \ - ')' + regex = r'\$(?:' \ + r'(?P\$)|' \ + r'(?:\{' \ + r'(?P[_a-zA-Z][_a-zA-Z0-9]*):' \ + r'(?P[_a-zA-Z][_a-zA-Z0-9]*)?' \ + r'\})|' \ + r'(?P)' \ + r')' pattern = re.compile(regex) tokens = [] lit_start = 0 diff --git a/shrinkwrap/utils/graph.py b/shrinkwrap/utils/graph.py index 5ecff5edc1de4b3483745af36c7f9ad173060857..bf843b90263f4ecdd6be32a2c8b2a8760bdfbabe 100644 --- a/shrinkwrap/utils/graph.py +++ b/shrinkwrap/utils/graph.py @@ -115,20 +115,25 @@ def execute(graph, tasks, verbose=False, colorize=True): active = 0 log = logger.Logger(27) ts = graphlib.TopologicalSorter(graph) + lognum = {} def _pump(pm): nonlocal queue nonlocal active nonlocal log + nonlocal lognum while len(queue) > 0 and active < tasks: frag = queue.pop() logname = None if frag.config and frag.component: + if frag.component not in lognum: + lognum[frag.component] = 0 logname = os.path.join(workspace.build, 'log', frag.config, - f'{frag.component}.log') + f'{frag.component}{lognum[frag.component]}.log') os.makedirs(os.path.dirname(logname), exist_ok=True) + lognum[frag.component] += 1 _update_labels(labels, mask, frag.config,