1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

utils: add helper to get all non-system packages

For example if PACKAGES is "foo foo-data foo-dev foo-doc", this will return
"foo-data".

(From OE-Core rev: 3115187e468398a8c1edaf3e5369a2d10fb112f4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2013-04-04 17:34:39 +01:00
committed by Richard Purdie
parent 59e425455f
commit 0e904db7da
2 changed files with 43 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import unittest
import bb, oe.utils
class TestPackagesFilterOutSystem(unittest.TestCase):
def test_filter(self):
"""
Test that oe.utils.packages_filter_out_system works.
"""
d = bb.data_smart.DataSmart()
d.setVar("PN", "foo")
d.setVar("PACKAGES", "foo foo-doc foo-dev")
pkgs = oe.utils.packages_filter_out_system(d)
self.assertEqual(pkgs, [])
d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
pkgs = oe.utils.packages_filter_out_system(d)
self.assertEqual(pkgs, ["foo-data"])
d.setVar("PACKAGES", "foo foo-locale-en-gb")
pkgs = oe.utils.packages_filter_out_system(d)
self.assertEqual(pkgs, [])
d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
pkgs = oe.utils.packages_filter_out_system(d)
self.assertEqual(pkgs, ["foo-data"])