Do not assume that only one script is delivered.
Replace by a loop

Change-Id: I389d202e61f47761dff88f12e6a63ef4687b513f
This commit is contained in:
Bruno Cornec 2017-03-07 17:43:59 +01:00 committed by Uggla
parent 7331f6e267
commit ea995f722a

View File

@ -70,11 +70,19 @@ class DataFilesHelper(object):
self.update_setupstruc(src, dst)
try:
# Create an entry for scripts if available
self.data['script'] = {'src': [],
'fdst': [],
'dst': 'bin'}
src = config.get('files', 'scripts').split('\n')
src = [self.refinesrc(file)[0] for file in src if file]
self.data['script'] = {'src': src,
'dst': 'bin',
'fdst': self.calculatedst(src, 'bin')}
# print("List handled: {}\n".format(src))
listsrc = []
for s in src:
if not s:
continue
# print("Source handled: {}".format(s))
listsrc.append(s)
self.data['script']['src'] = listsrc
self.data['script']['fdst'] = self.calculatedst(listsrc, "bin")
except configparser.NoOptionError:
pass
pp = pprint.PrettyPrinter(indent=4)
@ -117,7 +125,7 @@ class DataFilesHelper(object):
return(file)
def calculatedst(self, src, dst):
'''Calculate the full destination path accordind to source and
'''Calculate the full destination path according to source and
destination
:param src: source files