Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix depends for conversion types in IMAGE_TYPEDEP_*
@ 2017-01-05 23:15 Randy Witt
  2017-01-05 23:15 ` [PATCH 1/2] image_typedep.py: Add a test that ensures conversion type deps get added Randy Witt
  2017-01-05 23:15 ` [PATCH 2/2] image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types Randy Witt
  0 siblings, 2 replies; 3+ messages in thread
From: Randy Witt @ 2017-01-05 23:15 UTC (permalink / raw)
  To: openembedded-core

Fix conversion type dependencies missing when set in IMAGE_TYPEDEP_*. This
also adds a test.

The following changes since commit 9f6a1043f68580ed9604e750fd0f993f933bb66e:

  bitbake: prserv/serv: Tweak stdout manipulation to be stream safe (2017-01-05 13:54:07 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib rewitt/image_typedep
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rewitt/image_typedep

Randy Witt (2):
  image_typedep.py: Add a test that ensures conversion type deps get
    added
  image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types

 meta/classes/image_types.bbclass        | 14 +++++++--
 meta/lib/oeqa/selftest/image_typedep.py | 51 +++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 3 deletions(-)
 create mode 100644 meta/lib/oeqa/selftest/image_typedep.py

-- 
2.7.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] image_typedep.py: Add a test that ensures conversion type deps get added
  2017-01-05 23:15 [PATCH 0/2] Fix depends for conversion types in IMAGE_TYPEDEP_* Randy Witt
@ 2017-01-05 23:15 ` Randy Witt
  2017-01-05 23:15 ` [PATCH 2/2] image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types Randy Witt
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Witt @ 2017-01-05 23:15 UTC (permalink / raw)
  To: openembedded-core

Add a test that ensures if IMAGE_TYPEDEP_* contains a conversion type,
that the corresponding CONVERSION_DEPENDS_ for that type gets added to
the dependency tree for do_rootfs.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
---
 meta/lib/oeqa/selftest/image_typedep.py | 51 +++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/image_typedep.py

diff --git a/meta/lib/oeqa/selftest/image_typedep.py b/meta/lib/oeqa/selftest/image_typedep.py
new file mode 100644
index 0000000..256142d25
--- /dev/null
+++ b/meta/lib/oeqa/selftest/image_typedep.py
@@ -0,0 +1,51 @@
+import os
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake
+
+class ImageTypeDepTests(oeSelfTest):
+
+    # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
+    # the conversion type bar gets added as a dep as well
+    def test_conversion_typedep_added(self):
+
+        self.write_recipeinc('emptytest', """
+# Try to empty out the default dependency list
+PACKAGE_INSTALL = ""
+DISTRO_EXTRA_RDEPENDS=""
+
+LICENSE = "MIT"
+IMAGE_FSTYPES = "testfstype"
+
+IMAGE_TYPES_MASKED += "testfstype"
+IMAGE_TYPEDEP_testfstype = "tar.bz2"
+
+inherit image
+
+""")
+        # First get the dependency that should exist for bz2, it will look
+        # like CONVERSION_DEPENDS_bz2="somedep"
+        result = bitbake('-e emptytest')
+
+        for line in result.output.split('\n'):
+            if line.startswith('CONVERSION_DEPENDS_bz2'):
+                dep = line.split('=')[1].strip('"')
+                break
+
+        # Now get the dependency task list and check for the expected task
+        # dependency
+        bitbake('-g emptytest')
+
+        taskdependsfile = os.path.join(self.builddir, 'task-depends.dot')
+        dep =  dep + ".do_populate_sysroot"
+        depfound = False
+        expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
+
+        with open(taskdependsfile, "r") as f:
+            for line in f:
+                if line.strip() == expectedline:
+                    depfound = True
+                    break
+
+        if not depfound:
+            raise AssertionError("\"{}\" not found".format(expectedline))
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types
  2017-01-05 23:15 [PATCH 0/2] Fix depends for conversion types in IMAGE_TYPEDEP_* Randy Witt
  2017-01-05 23:15 ` [PATCH 1/2] image_typedep.py: Add a test that ensures conversion type deps get added Randy Witt
@ 2017-01-05 23:15 ` Randy Witt
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Witt @ 2017-01-05 23:15 UTC (permalink / raw)
  To: openembedded-core

Previously if IMAGE_TYPEDEP_* contained a conversion type of the form,
"foo.bar", the dependency on CONVERSION_DEPENDS_bar would not get added
to the task depends for do_rootfs.

[YOCTO #10883]

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
---
 meta/classes/image_types.bbclass | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 8f04849..c2ad141 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -17,17 +17,25 @@ def imagetypes_getdepends(d):
                 d += ":do_populate_sysroot"
             deps.add(d)
 
+    # Take a type in the form of foo.bar.car and split it into the items
+    # needed for the image deps "foo", and the conversion deps ["bar", "car"]
+    def split_types(typestring):
+        types = typestring.split(".")
+        return types[0], types[1:]
+
     fstypes = set((d.getVar('IMAGE_FSTYPES') or "").split())
     fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS') or "").split())
 
     deps = set()
     for typestring in fstypes:
-        types = typestring.split(".")
-        basetype, resttypes = types[0], types[1:]
-
+        basetype, resttypes = split_types(typestring)
         adddep(d.getVar('IMAGE_DEPENDS_%s' % basetype) , deps)
+
         for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype) or "").split():
+            base, rest = split_types(typedepends)
+            resttypes += rest
             adddep(d.getVar('IMAGE_DEPENDS_%s' % typedepends) , deps)
+
         for ctype in resttypes:
             adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype), deps)
             adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype), deps)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-05 23:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05 23:15 [PATCH 0/2] Fix depends for conversion types in IMAGE_TYPEDEP_* Randy Witt
2017-01-05 23:15 ` [PATCH 1/2] image_typedep.py: Add a test that ensures conversion type deps get added Randy Witt
2017-01-05 23:15 ` [PATCH 2/2] image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types Randy Witt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox