All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [wic][PATCH v2 4/9] wic: ksparser: add support for include
Date: Tue, 19 Jan 2016 18:51:06 +0200	[thread overview]
Message-ID: <d97546d3b2b63fca3b6aff8958559441a0c6cb11.1453222163.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1453222163.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1453222163.git.ed.bartosh@linux.intel.com>

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

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 scripts/lib/wic/ksparser.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 0191a84..c73a456 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -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:
-- 
2.1.4



  parent reply	other threads:[~2016-01-19 18:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 16:51 [wic][PATCH v2 0/9] wic: implement 'include' command Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 1/9] wic: move wks parsing code to KickStart._parse Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 2/9] wic: use unique partition number Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 3/9] wic: do not remove build dir in source plugins Ed Bartosh
2016-01-19 16:51 ` Ed Bartosh [this message]
2016-01-19 16:51 ` [wic][PATCH v2 5/9] wic: refactor get_boot_config Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 6/9] wic: implement search of includes Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 7/9] wic: move parts of canned .wks into common.wks.inc Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 8/9] wic: add help for 'include' command Ed Bartosh
2016-01-19 16:51 ` [wic][PATCH v2 9/9] wic: pylinted ksparser module Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d97546d3b2b63fca3b6aff8958559441a0c6cb11.1453222163.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.