wic: ksparser: add support for include

Extended parser to support inclusion of .ks files:
    recursively called self._parse to parse included .ks

(From OE-Core rev: 33dd323ec6a1a1ed4e1a04e51de182c89c7b6bd9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh 2016-01-19 18:51:06 +02:00 committed by Richard Purdie
parent 3fc6aaa186
commit d304162269
1 changed files with 6 additions and 1 deletions

View File

@ -116,6 +116,9 @@ class KickStart(object):
bootloader.add_argument('--timeout', type=int)
bootloader.add_argument('--source')
include = subparsers.add_parser('include')
include.add_argument('path')
self._parse(parser, confpath)
def _parse(self, parser, confpath):
@ -133,7 +136,9 @@ class KickStart(object):
if line.startswith('part'):
self.partnum += 1
self.partitions.append(Partition(parsed, self.partnum))
else:
elif line.startswith('include'):
self._parse(parser, parsed.path)
elif line.startswith('bootloader'):
if not self.bootloader:
self.bootloader = parsed
else: