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 2/9] wic: use unique partition number
Date: Tue, 19 Jan 2016 18:51:04 +0200	[thread overview]
Message-ID: <fba7fd0b86cd522526577c63fa975a7283cf4bd3.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>

This is a preparation for 'include' support.

Used unique counter instead of line number for partitions
in .ks file. Line numbers can be equal for different .ks files,
which can cause problems if one .ks file is included into
another.

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

diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index e366f61..0191a84 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -84,6 +84,7 @@ class KickStart(object):
         self.partitions = []
         self.bootloader = None
         self.lineno = 0
+        self.partnum = 0
 
         parser = KickStartParser()
         subparsers = parser.add_subparsers()
@@ -130,7 +131,8 @@ class KickStart(object):
                         raise KickStartError('%s:%d: %s' % \
                                              (confpath, lineno, err))
                     if line.startswith('part'):
-                        self.partitions.append(Partition(parsed, lineno))
+                        self.partnum += 1
+                        self.partitions.append(Partition(parsed, self.partnum))
                     else:
                         if not self.bootloader:
                              self.bootloader = parsed
-- 
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 ` Ed Bartosh [this message]
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 ` [wic][PATCH v2 4/9] wic: ksparser: add support for include Ed Bartosh
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=fba7fd0b86cd522526577c63fa975a7283cf4bd3.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.