diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2014-12-24 14:32:11 -0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-25 08:18:12 +0000 |
commit | 01c7d083ef63d16eac083b6c75b5d2bce0073cff (patch) | |
tree | 54b32935b358bf9ff67962af13d7dc7d818461dc /meta/lib/oe/image.py | |
parent | 7856fb3f0c5d3892ef04a35e2bc8e08a2806109e (diff) | |
download | poky-01c7d083ef63d16eac083b6c75b5d2bce0073cff.tar.gz |
lib/oe/image.py: Handle compressed IMAGE_TYPEDEP values
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.
(From OE-Core rev: 6e7d1de6cc99ed2def346dc40310573f5f0ce5ca)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/image.py')
-rw-r--r-- | meta/lib/oe/image.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py index 7e080b00dd..f9c8f84cf8 100644 --- a/meta/lib/oe/image.py +++ b/meta/lib/oe/image.py | |||
@@ -48,11 +48,13 @@ class ImageDepGraph(object): | |||
48 | graph = dict() | 48 | graph = dict() |
49 | 49 | ||
50 | def add_node(node): | 50 | def add_node(node): |
51 | base_type = self._image_base_type(node) | ||
51 | deps = (self.d.getVar('IMAGE_TYPEDEP_' + node, True) or "") | 52 | deps = (self.d.getVar('IMAGE_TYPEDEP_' + node, True) or "") |
52 | if deps != "": | 53 | base_deps = (self.d.getVar('IMAGE_TYPEDEP_' + base_type, True) or "") |
54 | if deps != "" or base_deps != "": | ||
53 | graph[node] = deps | 55 | graph[node] = deps |
54 | 56 | ||
55 | for dep in deps.split(): | 57 | for dep in deps.split() + base_deps.split(): |
56 | if not dep in graph: | 58 | if not dep in graph: |
57 | add_node(dep) | 59 | add_node(dep) |
58 | else: | 60 | else: |
@@ -72,6 +74,18 @@ class ImageDepGraph(object): | |||
72 | for item in remove_list: | 74 | for item in remove_list: |
73 | self.graph.pop(item, None) | 75 | self.graph.pop(item, None) |
74 | 76 | ||
77 | def _image_base_type(self, type): | ||
78 | ctypes = self.d.getVar('COMPRESSIONTYPES', True).split() | ||
79 | if type in ["vmdk", "live", "iso", "hddimg"]: | ||
80 | type = "ext3" | ||
81 | basetype = type | ||
82 | for ctype in ctypes: | ||
83 | if type.endswith("." + ctype): | ||
84 | basetype = type[:-len("." + ctype)] | ||
85 | break | ||
86 | |||
87 | return basetype | ||
88 | |||
75 | def _compute_dependencies(self): | 89 | def _compute_dependencies(self): |
76 | """ | 90 | """ |
77 | returns dict object of nodes with [no_of_depends_on, no_of_depended_by] | 91 | returns dict object of nodes with [no_of_depends_on, no_of_depended_by] |