public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Otavio Salvador <otavio@ossystems.com.br>
To: OpenEmbedded Core Mailing List
	<openembedded-core@lists.openembedded.org>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Subject: [PATCH v2 3/3] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values
Date: Wed, 24 Dec 2014 14:32:11 -0200	[thread overview]
Message-ID: <1419438731-623-3-git-send-email-otavio@ossystems.com.br> (raw)
In-Reply-To: <1419438731-623-1-git-send-email-otavio@ossystems.com.br>

When computing the dependency graph for the image generation, we need
to take into account the compression type and identify the base type
it relates to. This allow for a more robust graph generation even when
using composed image types.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/lib/oe/image.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index 7e080b0..f9c8f84 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -48,11 +48,13 @@ class ImageDepGraph(object):
         graph = dict()
 
         def add_node(node):
+            base_type = self._image_base_type(node)
             deps = (self.d.getVar('IMAGE_TYPEDEP_' + node, True) or "")
-            if deps != "":
+            base_deps = (self.d.getVar('IMAGE_TYPEDEP_' + base_type, True) or "")
+            if deps != "" or base_deps != "":
                 graph[node] = deps
 
-                for dep in deps.split():
+                for dep in deps.split() + base_deps.split():
                     if not dep in graph:
                         add_node(dep)
             else:
@@ -72,6 +74,18 @@ class ImageDepGraph(object):
         for item in remove_list:
             self.graph.pop(item, None)
 
+    def _image_base_type(self, type):
+        ctypes = self.d.getVar('COMPRESSIONTYPES', True).split()
+        if type in ["vmdk", "live", "iso", "hddimg"]:
+            type = "ext3"
+        basetype = type
+        for ctype in ctypes:
+            if type.endswith("." + ctype):
+                basetype = type[:-len("." + ctype)]
+                break
+
+        return basetype
+
     def _compute_dependencies(self):
         """
         returns dict object of nodes with [no_of_depends_on, no_of_depended_by]
-- 
2.1.3



  parent reply	other threads:[~2014-12-24 16:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-24 16:32 [PATCH v2 1/3] image_types.bbclass: Respect IMAGE_TYPEDEP dependencies Otavio Salvador
2014-12-24 16:32 ` [PATCH v2 2/3] image_types.bbclass: Rework code to map types for 'ext3' Otavio Salvador
2014-12-24 16:32 ` Otavio Salvador [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-12-09 21:07 [PATCH v2 1/3] image_types.bbclass: Respect IMAGE_TYPEDEP dependencies Otavio Salvador
2014-12-09 21:07 ` [PATCH v2 3/3] lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values Otavio Salvador

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=1419438731-623-3-git-send-email-otavio@ossystems.com.br \
    --to=otavio@ossystems.com.br \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox