]> code.ossystems Code Review - openembedded-core.git/commitdiff
Globally replace oe.utils.contains to bb.utils.contains
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 24 Apr 2014 18:59:19 +0000 (15:59 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 25 Apr 2014 16:10:58 +0000 (17:10 +0100)
BitBake has the exact same code as oe.utils.contains so there's no
reason to duplicate it. We now rely on the bb.utils.contains code for
metadata.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
15 files changed:
meta/classes/libc-package.bbclass
meta/classes/systemd.bbclass
meta/classes/update-rc.d.bbclass
meta/classes/utils.bbclass
meta/lib/oe/rootfs.py
meta/lib/oe/utils.py
meta/recipes-core/dbus/dbus.inc
meta/recipes-core/systemd/systemd-serialgetty.bb
meta/recipes-core/systemd/systemd_211.bb
meta/recipes-core/udev/udev.inc
meta/recipes-devtools/dpkg/dpkg.inc
meta/recipes-devtools/gcc/gcc-common.inc
meta/recipes-devtools/opkg/opkg.inc
meta/recipes-devtools/perl/perl-ptest.inc
meta/recipes-graphics/xorg-driver/xf86-video-omap_git.bb

index 0af42a002ce95f25ba810cb454d6ddfaa1553075..c1bc399c1872475e03499202637b9fffa3a821f7 100644 (file)
@@ -37,9 +37,9 @@ python __anonymous () {
                 break
 
     # try to fix disable charsets/locales/locale-code compile fail
-    if oe.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
-            oe.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
-            oe.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
+    if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
+            bb.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
+            bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
         d.setVar('PACKAGE_NO_GCONV', '0')
     else:
         d.setVar('PACKAGE_NO_GCONV', '1')
index 2bd63a405b7e2f618f6617460956d3618577811b..a6ad723dfdf36950d3c7a1bff3c089e1852275b8 100644 (file)
@@ -15,9 +15,9 @@ python __anonymous() {
     # If the distro features have systemd but not sysvinit, inhibit update-rcd
     # from doing any work so that pure-systemd images don't have redundant init
     # files.
-    if oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         d.appendVar("DEPENDS", " systemd-systemctl-native")
-        if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
             d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
@@ -57,7 +57,7 @@ fi
 systemd_populate_packages[vardeps] += "systemd_prerm systemd_postinst"
 
 python systemd_populate_packages() {
-    if not oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+    if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         return
 
     def get_package_var(d, var, pkg):
@@ -172,7 +172,7 @@ PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
 
 python rm_systemd_unitdir (){
     import shutil
-    if not oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+    if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
         if os.path.exists(systemd_unitdir):
             shutil.rmtree(systemd_unitdir)
@@ -186,8 +186,8 @@ python rm_sysvinit_initddir (){
     import shutil
     sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d"))
 
-    if oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
-        not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
+        not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
         os.path.exists(sysv_initddir):
         systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True), "system")
 
index 0ac2af7d973916a25d5330bfc66f834789ef7349..81cc97621ae5750d16da0242ae11375d56d9cf11 100644 (file)
@@ -117,7 +117,7 @@ python populate_packages_updatercd () {
 
     # Check that this class isn't being inhibited (generally, by
     # systemd.bbclass) before doing any work.
-    if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
        not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
         pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
         if pkgs == None:
index 89ad8c55314d70937c70808d13f606ac4820995c..0ee13e04d72d0e851f35e4a10399e4f81aeeb0c1 100644 (file)
@@ -24,7 +24,7 @@ def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
     return oe.utils.version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
 
 def base_contains(variable, checkvalues, truevalue, falsevalue, d):
-    return oe.utils.contains(variable, checkvalues, truevalue, falsevalue, d)
+    return bb.utils.contains(variable, checkvalues, truevalue, falsevalue, d)
 
 def base_both_contain(variable1, variable2, checkvalue, d):
     return oe.utils.both_contain(variable1, variable2, checkvalue, d)
index dddbef4d64e9dbe0b275ccf24743a98c83b423ce..3d1111a40abc78b8af9a525c586d831b06f0f70e 100644 (file)
@@ -1,6 +1,5 @@
 from abc import ABCMeta, abstractmethod
 from oe.utils import execute_pre_post_process
-from oe.utils import contains as base_contains
 from oe.package_manager import *
 from oe.manifest import *
 import oe.path
@@ -42,7 +41,7 @@ class Rootfs(object):
         pass
 
     def _insert_feed_uris(self):
-        if base_contains("IMAGE_FEATURES", "package-management",
+        if bb.utils.contains("IMAGE_FEATURES", "package-management",
                          True, False, self.d):
             self.pm.insert_feeds_uris()
 
@@ -108,7 +107,7 @@ class Rootfs(object):
 
         execute_pre_post_process(self.d, post_process_cmds)
 
-        if base_contains("IMAGE_FEATURES", "read-only-rootfs",
+        if bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
                          True, False, self.d):
             delayed_postinsts = self._get_delayed_postinsts()
             if delayed_postinsts is not None:
@@ -130,7 +129,7 @@ class Rootfs(object):
         self._cleanup()
 
     def _uninstall_uneeded(self):
-        if base_contains("IMAGE_FEATURES", "package-management",
+        if bb.utils.contains("IMAGE_FEATURES", "package-management",
                          True, False, self.d):
             return
 
index defa53679be3fa7c148215aae1844da9d3d58c16..0a1d1080c94558b29802a2c16a71a8b5251e38a8 100644 (file)
@@ -41,19 +41,6 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
     else:
         return falsevalue
 
-def contains(variable, checkvalues, truevalue, falsevalue, d):
-    val = d.getVar(variable, True)
-    if not val:
-        return falsevalue
-    val = set(val.split())
-    if isinstance(checkvalues, basestring):
-        checkvalues = set(checkvalues.split())
-    else:
-        checkvalues = set(checkvalues)
-    if checkvalues.issubset(val):
-        return truevalue
-    return falsevalue
-
 def both_contain(variable1, variable2, checkvalue, d):
     if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1:
         return checkvalue
index 5727ae77b22365b3959700009adc342302661298..8d348f8f25be92e87ca2dbf6bb9c12ebe3b379e0 100644 (file)
@@ -25,7 +25,7 @@ INITSCRIPT_NAME = "dbus-1"
 INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
 
 python __anonymous() {
-    if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
index 13b2dbacec6eea8d1924a9cd6686f09deaa173e2..1c34d5c747cd3db802bcf5d51b03f74d45534f79 100644 (file)
@@ -44,6 +44,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 # As this package is tied to systemd, only build it when we're also building systemd.
 python () {
-    if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+    if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
         raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
 }
index 44b196538a4eaa263240873fa2046e627c25eb40..278de9fd561c4faec4fdb70cc5bc97c3c29fc942 100644 (file)
@@ -295,7 +295,7 @@ INITSCRIPT_NAME_udev = "systemd-udevd"
 INITSCRIPT_PARAMS_udev = "start 03 S ."
 
 python __anonymous() {
-    if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
@@ -348,6 +348,6 @@ pkg_prerm_udev-hwdb () {
 # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
 # that we don't build both udev and systemd in world builds.
 python () {
-    if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+    if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
         raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
 }
index 1b22525436c9f24d785d8e9aa670a7e88ec2325f..f9d544e86a9ab0749ad28609357193afc17fcb20 100644 (file)
@@ -99,7 +99,7 @@ do_install_append () {
 
 # As systemd also builds udev, skip this package if we're doing a systemd build.
 python () {
-    if oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+    if bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
         raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
 }
 do_compile_ptest() {
index eef7ce9d40ee40124183ec46ca4ebfe3072530f5..ca44e98232529163d44f95dc3e32f8d3f8010f29 100644 (file)
@@ -17,7 +17,7 @@ PARALLEL_MAKE = ""
 inherit autotools gettext perlnative pkgconfig systemd
 
 python () {
-    if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
         pn = d.getVar('PN', True)
         d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
 }
index feb402e75d3e613756b8a9dd4042f929621509b5..1e00249b1921aa817888e5cdd4ee6fa27480ab71 100644 (file)
@@ -19,7 +19,7 @@ def get_gcc_fpu_setting(bb, d):
 get_gcc_fpu_setting[vardepvalue] = "${@get_gcc_fpu_setting(bb, d)}"
 
 def get_gcc_mips_plt_setting(bb, d):
-    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and oe.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
+    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
         return "--with-mips-plt"
     return ""
 
@@ -32,7 +32,7 @@ def get_gcc_multiarch_setting(bb, d):
         "sparc":   "--enable-targets=all",
     }
 
-    if oe.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
+    if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
         if target_arch in multiarch_options :
             return multiarch_options[target_arch]
     return ""
index 9f87df551ebf6a7fedc43b7d60b9cc218f77a210..198e5001af85a0b384378c847c18241c0e226517 100644 (file)
@@ -17,7 +17,7 @@ do_configure_prepend() {
 inherit autotools pkgconfig systemd
 
 python () {
-    if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
         pn = d.getVar('PN', True)
         d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'opkg-configure.service')
 }
index 914ca0f4c0bb4a53c8f9a001f26fa8bc0fb18be2..9ef7d0a262b20b4d262f42a8304299c13d9a1728 100644 (file)
@@ -42,7 +42,7 @@ python populate_packages_prepend() {
     # Put all *.t files from the lib dir in the ptest package
     # do_split_packages requires a pair of () in the regex, but we have nothing
     # to match, so use an empty pair.
-    if oe.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+    if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
         do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
             '${PN}-ptest%s', '%s', recursive=True, match_path=True)
 }
index 97941ecc0cb9ac79fd435541e03e3c957e532bb2..454d0a1fb251bd71b0fb2653254e09903aafce3e 100644 (file)
@@ -42,7 +42,7 @@ do_compile_prepend_armv7a () {
 }
 
 python () {
-    if not oe.utils.contains ('DISTRO_FEATURES', 'opengl', True, False, d):
+    if not bb.utils.contains ('DISTRO_FEATURES', 'opengl', True, False, d):
         raise bb.parse.SkipPackage("'opengl' not in DISTRO_FEATURES")
 }