Skip to content
Snippets Groups Projects
Commit 11951148 authored by Martin Craig's avatar Martin Craig
Browse files

Handle conflicts in output where two outputs have the same name (without file extension)

parent 68494421
No related branches found
No related tags found
No related merge requests found
...@@ -858,7 +858,6 @@ class _FileOrThing(object): ...@@ -858,7 +858,6 @@ class _FileOrThing(object):
for prefixed in it.chain(*allPrefixed): for prefixed in it.chain(*allPrefixed):
fullpath = prefixed fullpath = prefixed
prefixed = op.relpath(prefixed, workdir) prefixed = op.relpath(prefixed, workdir)
for prefPat, prefName in prefixes.items(): for prefPat, prefName in prefixes.items():
if not fnmatch.fnmatch(prefixed, '{}*'.format(prefPat)): if not fnmatch.fnmatch(prefixed, '{}*'.format(prefPat)):
continue continue
...@@ -871,9 +870,13 @@ class _FileOrThing(object): ...@@ -871,9 +870,13 @@ class _FileOrThing(object):
# not of the correct type. # not of the correct type.
fval = self.__load(fullpath) fval = self.__load(fullpath)
if fval is not None: if fval is not None:
prefixed = self.__removeExt(prefixed) noext = self.__removeExt(prefixed)
prefixed = re.sub('^' + prefPat, prefName, prefixed) noext = re.sub('^' + prefPat, prefName, noext)
result[prefixed] = fval if noext not in result:
result[noext] = fval
else:
withext = re.sub('^' + prefPat, prefName, prefixed)
result[withext] = fval
break break
return result return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment