meta-openembedded and poky: subtree updates

Squash of the following due to dependencies among them
and OpenBMC changes:

meta-openembedded: subtree update:d0748372d2..9201611135
meta-openembedded: subtree update:9201611135..17fd382f34
poky: subtree update:9052e5b32a..2e11d97b6c
poky: subtree update:2e11d97b6c..a8544811d7

The change log was too large for the jenkins plugin
to handle therefore it has been removed. Here is
the first and last commit of each subtree:

meta-openembedded:d0748372d2
      cppzmq: bump to version 4.6.0
meta-openembedded:17fd382f34
      mpv: Remove X11 dependency
poky:9052e5b32a
      package_ipk: Remove pointless comment to trigger rebuild
poky:a8544811d7
      pbzip2: Fix license warning

Change-Id: If0fc6c37629642ee207a4ca2f7aa501a2c673cd6
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/poky/meta/lib/oeqa/selftest/cases/archiver.py b/poky/meta/lib/oeqa/selftest/cases/archiver.py
index f8672f8..606eaab 100644
--- a/poky/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/poky/meta/lib/oeqa/selftest/cases/archiver.py
@@ -129,3 +129,128 @@
         self.write_config(features)
 
         bitbake('-n core-image-sato')
+
+    def _test_archiver_mode(self, mode, target_file_name, extra_config=None):
+        target = "selftest-ed"
+
+        features = 'INHERIT += "archiver"\n'
+        features +=  'ARCHIVER_MODE[src] = "%s"\n' % (mode)
+        if extra_config:
+            features += extra_config
+        self.write_config(features)
+
+        bitbake('-c clean %s' % (target))
+        bitbake('-c deploy_archives %s' % (target))
+
+        bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
+        glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'], '%s-*' % (target))
+        glob_result = glob.glob(glob_str)
+        self.assertTrue(glob_result, 'Missing archiver directory for %s' % (target))
+
+        archive_path = os.path.join(glob_result[0], target_file_name)
+        self.assertTrue(os.path.exists(archive_path), 'Missing archive file %s' % (target_file_name))
+
+    def test_archiver_mode_original(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[src] = "original"`.
+        """
+
+        self._test_archiver_mode('original', 'ed-1.14.1.tar.lz')
+
+    def test_archiver_mode_patched(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[src] = "patched"`.
+        """
+
+        self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-patched.tar.gz')
+
+    def test_archiver_mode_configured(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[src] = "configured"`.
+        """
+
+        self._test_archiver_mode('configured', 'selftest-ed-1.14.1-r0-configured.tar.gz')
+
+    def test_archiver_mode_recipe(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[recipe] = "1"`.
+        """
+
+        self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-recipe.tar.gz',
+                                 'ARCHIVER_MODE[recipe] = "1"\n')
+
+    def test_archiver_mode_diff(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[diff] = "1"`.
+        Exclusions controlled by `ARCHIVER_MODE[diff-exclude]` are not yet tested.
+        """
+
+        self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-diff.gz',
+                                 'ARCHIVER_MODE[diff] = "1"\n')
+
+    def test_archiver_mode_dumpdata(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[dumpdata] = "1"`.
+        """
+
+        self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-showdata.dump',
+                                 'ARCHIVER_MODE[dumpdata] = "1"\n')
+
+    def test_archiver_mode_mirror(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[src] = "mirror"`.
+        """
+
+        self._test_archiver_mode('mirror', 'ed-1.14.1.tar.lz',
+                                 'BB_GENERATE_MIRROR_TARBALLS = "1"\n')
+
+    def test_archiver_mode_mirror_excludes(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[src] = "mirror"` and
+        correctly excludes an archive when its URL matches
+        `ARCHIVER_MIRROR_EXCLUDE`.
+        """
+
+        target='selftest-ed'
+        target_file_name = 'ed-1.14.1.tar.lz'
+
+        features = 'INHERIT += "archiver"\n'
+        features += 'ARCHIVER_MODE[src] = "mirror"\n'
+        features += 'BB_GENERATE_MIRROR_TARBALLS = "1"\n'
+        features += 'ARCHIVER_MIRROR_EXCLUDE = "${GNU_MIRROR}"\n'
+        self.write_config(features)
+
+        bitbake('-c clean %s' % (target))
+        bitbake('-c deploy_archives %s' % (target))
+
+        bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
+        glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'], '%s-*' % (target))
+        glob_result = glob.glob(glob_str)
+        self.assertTrue(glob_result, 'Missing archiver directory for %s' % (target))
+
+        archive_path = os.path.join(glob_result[0], target_file_name)
+        self.assertFalse(os.path.exists(archive_path), 'Failed to exclude archive file %s' % (target_file_name))
+
+    def test_archiver_mode_mirror_combined(self):
+        """
+        Test that the archiver works with `ARCHIVER_MODE[src] = "mirror"`
+        and `ARCHIVER_MODE[mirror] = "combined"`. Archives for multiple recipes
+        should all end up in the 'mirror' directory.
+        """
+
+        features = 'INHERIT += "archiver"\n'
+        features += 'ARCHIVER_MODE[src] = "mirror"\n'
+        features += 'ARCHIVER_MODE[mirror] = "combined"\n'
+        features += 'BB_GENERATE_MIRROR_TARBALLS = "1"\n'
+        features += 'COPYLEFT_LICENSE_INCLUDE = "*"\n'
+        self.write_config(features)
+
+        for target in ['selftest-ed', 'selftest-hardlink']:
+            bitbake('-c clean %s' % (target))
+            bitbake('-c deploy_archives %s' % (target))
+
+        bb_vars = get_bb_vars(['DEPLOY_DIR_SRC'])
+        for target_file_name in ['ed-1.14.1.tar.lz', 'hello.c']:
+            glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], 'mirror', target_file_name)
+            glob_result = glob.glob(glob_str)
+            self.assertTrue(glob_result, 'Missing archive file %s' % (target_file_name))