From: Katarzyna Gorska Date: Tue, 29 Aug 2017 12:02:11 +0000 (+0200) Subject: Add possibility to parse list of partition files X-Git-Tag: accepted/tizen/5.0/unified/20181102.025509^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13d5bf8eeacf710c68febc37408f985e58ed12f7;p=platform%2Fupstream%2Fkickstarter.git Add possibility to parse list of partition files Kickstarter was not able to correctly parse config files that contained a list of partition files in "Part" section. Now it is possible to add several partition files in that section. Change-Id: Idcb22bd6bcb17061b9c7b5af8dea222283216e2c Signed-off-by: Katarzyna Gorska --- diff --git a/kswriter/KSWriter.py b/kswriter/KSWriter.py index b5e97a3..bae1e36 100644 --- a/kswriter/KSWriter.py +++ b/kswriter/KSWriter.py @@ -138,9 +138,19 @@ class KSWriter(): ptab = "" for g in [ plat, img ]: if g.has_key("Part"): - f = open("%s/partitions/%s" %(meta_root, g['Part']) ) - ptab = f.read() - f.close() + if type(g['Part']) == str: + t = [g['Part']] + elif type(g['Part']) == list: + t = g['Part'] + ptab = "" + for p in t: + if os.path.exists('%s/partitions/%s' %(meta_root,p)): + f = open("%s/partitions/%s" %(meta_root, p) ) + ptab += f.read() + ptab += "\n" + f.close() + else: + raise KSMetaError('%s/partitions/%s.run not found, aborting.' %(meta_root,p)) conf['Part'] = ptab conf['Post'] = postscript