]> code.ossystems Code Review - openembedded-core.git/commitdiff
mesa: fix mesa_populate_packages() when dri is disabled
authorHerve Jourdain <herve.jourdain@neuf.fr>
Wed, 18 May 2016 12:33:37 +0000 (20:33 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 May 2016 09:20:22 +0000 (10:20 +0100)
When compiling mesa, if dri is disabled in PACKAGECONFIG, or if the list of DRI
drivers is empty, it will cause populate_package to fail, because it can't find
- rightfully - the directory for the DRI drivers.  This patch checks that the
directory indeed exists before trying to get a list of the files in it

[ use oe.path.join instead of + - RB ]

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-graphics/mesa/mesa.inc

index a4e53516f396d095da48d29c34b7ac2e8f6a5a2a..1d084c0b85c00c8480f69f6bd4705d1ff3e45fef 100644 (file)
@@ -142,16 +142,17 @@ python mesa_populate_packages() {
         d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
 
     import re
-    dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
-    dri_pkgs = os.listdir(d.getVar('PKGD', True) + dri_drivers_root)
-    lib_name = d.expand("${MLPREFIX}mesa-megadriver")
-    for p in dri_pkgs:
-        m = re.match('^(.*)_dri\.so$', p)
-        if m:
-            pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
-            d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
-            d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
-            d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
+    dri_drivers_root = oe.path.join(d.getVar('PKGD', True), d.getVar('libdir', True), "dri")
+    if os.path.isdir(dri_drivers_root):
+        dri_pkgs = os.listdir(dri_drivers_root)
+        lib_name = d.expand("${MLPREFIX}mesa-megadriver")
+        for p in dri_pkgs:
+            m = re.match('^(.*)_dri\.so$', p)
+            if m:
+                pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
+                d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
+                d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
+                d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
 
     pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
     do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')