From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mail.openembedded.org (Postfix) with ESMTP id B611A6FF6B for ; Tue, 19 Jan 2016 18:48:36 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 19 Jan 2016 10:48:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,318,1449561600"; d="scan'208";a="32427918" Received: from linux.intel.com ([10.23.219.25]) by fmsmga004.fm.intel.com with ESMTP; 19 Jan 2016 10:48:09 -0800 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id E972B2C8001 for ; Tue, 19 Jan 2016 11:36:04 -0800 (PST) From: Ed Bartosh To: openembedded-core@lists.openembedded.org Date: Tue, 19 Jan 2016 18:51:04 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [wic][PATCH v2 2/9] wic: use unique partition number X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2016 18:48:37 -0000 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 --- 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