All of lore.kernel.org
 help / color / mirror / Atom feed
* [mesa][PATCH v2 0/1] Fix mesa_populate_packages() when dri is disabled
@ 2016-05-18 12:33 Herve Jourdain
  2016-05-18 12:33 ` [mesa][PATCH v2 1/1] " Herve Jourdain
  0 siblings, 1 reply; 9+ messages in thread
From: Herve Jourdain @ 2016-05-18 12:33 UTC (permalink / raw)
  To: openembedded-core

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

Herve Jourdain (1):
  Fix mesa_populate_packages() when dri is disabled

 meta/recipes-graphics/mesa/mesa.inc | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

-- 
2.7.4



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

* [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 12:33 [mesa][PATCH v2 0/1] Fix mesa_populate_packages() when dri is disabled Herve Jourdain
@ 2016-05-18 12:33 ` Herve Jourdain
  2016-05-18 14:14   ` Martin Jansa
  0 siblings, 1 reply; 9+ messages in thread
From: Herve Jourdain @ 2016-05-18 12:33 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
 meta/recipes-graphics/mesa/mesa.inc | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index a4e5351..0e46092 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -143,15 +143,16 @@ python mesa_populate_packages() {
 
     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)
+    if os.path.isdir(d.getVar('PKGD', True) + dri_drivers_root):
+        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)
 
     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='')
-- 
2.7.4



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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 12:33 ` [mesa][PATCH v2 1/1] " Herve Jourdain
@ 2016-05-18 14:14   ` Martin Jansa
  2016-05-18 15:26     ` Herve Jourdain
  2016-05-18 15:54     ` Burton, Ross
  0 siblings, 2 replies; 9+ messages in thread
From: Martin Jansa @ 2016-05-18 14:14 UTC (permalink / raw)
  To: Herve Jourdain; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2608 bytes --]

On Wed, May 18, 2016 at 08:33:37PM +0800, Herve Jourdain wrote:
> 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
> 
> Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
> ---
>  meta/recipes-graphics/mesa/mesa.inc | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
> index a4e5351..0e46092 100644
> --- a/meta/recipes-graphics/mesa/mesa.inc
> +++ b/meta/recipes-graphics/mesa/mesa.inc
> @@ -143,15 +143,16 @@ python mesa_populate_packages() {
>  
>      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)
> +    if os.path.isdir(d.getVar('PKGD', True) + dri_drivers_root):

Use os.path.join instead of +

> +        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)
>  
>      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='')
> -- 
> 2.7.4
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 14:14   ` Martin Jansa
@ 2016-05-18 15:26     ` Herve Jourdain
  2016-05-18 15:32       ` Martin Jansa
  2016-05-18 15:54     ` Burton, Ross
  1 sibling, 1 reply; 9+ messages in thread
From: Herve Jourdain @ 2016-05-18 15:26 UTC (permalink / raw)
  To: 'Martin Jansa'; +Cc: openembedded-core

Hi Martin,

Even though the line just below uses "+"? Or shall I modify both?

Herve

-----Original Message-----
From: Martin Jansa [mailto:martin.jansa@gmail.com] 
Sent: mercredi 18 mai 2016 16:15
To: Herve Jourdain <herve.jourdain@neuf.fr>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [mesa][PATCH v2 1/1] Fix mesa_populate_packages()
when dri is disabled

On Wed, May 18, 2016 at 08:33:37PM +0800, Herve Jourdain wrote:
> 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
> 
> Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
> ---
>  meta/recipes-graphics/mesa/mesa.inc | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/meta/recipes-graphics/mesa/mesa.inc
b/meta/recipes-graphics/mesa/mesa.inc
> index a4e5351..0e46092 100644
> --- a/meta/recipes-graphics/mesa/mesa.inc
> +++ b/meta/recipes-graphics/mesa/mesa.inc
> @@ -143,15 +143,16 @@ python mesa_populate_packages() {
>  
>      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)
> +    if os.path.isdir(d.getVar('PKGD', True) + dri_drivers_root):

Use os.path.join instead of +

> +        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)
>  
>      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='')
> -- 
> 2.7.4
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 15:26     ` Herve Jourdain
@ 2016-05-18 15:32       ` Martin Jansa
  2016-05-18 19:34         ` Burton, Ross
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Jansa @ 2016-05-18 15:32 UTC (permalink / raw)
  To: Herve Jourdain; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 3535 bytes --]

On Wed, May 18, 2016 at 05:26:16PM +0200, Herve Jourdain wrote:
> Hi Martin,
> 
> Even though the line just below uses "+"? Or shall I modify both?

Ah that's where it came from. Sorry I haven't noticed that it was
already there.

Please ignore what I said, os.path.join won't work anyway, because
libdir starts with slash so os.path.join would just return that part.

Thanks and sorry for noise

> -----Original Message-----
> From: Martin Jansa [mailto:martin.jansa@gmail.com] 
> Sent: mercredi 18 mai 2016 16:15
> To: Herve Jourdain <herve.jourdain@neuf.fr>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [mesa][PATCH v2 1/1] Fix mesa_populate_packages()
> when dri is disabled
> 
> On Wed, May 18, 2016 at 08:33:37PM +0800, Herve Jourdain wrote:
> > 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
> > 
> > Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
> > ---
> >  meta/recipes-graphics/mesa/mesa.inc | 19 ++++++++++---------
> >  1 file changed, 10 insertions(+), 9 deletions(-)
> > 
> > diff --git a/meta/recipes-graphics/mesa/mesa.inc
> b/meta/recipes-graphics/mesa/mesa.inc
> > index a4e5351..0e46092 100644
> > --- a/meta/recipes-graphics/mesa/mesa.inc
> > +++ b/meta/recipes-graphics/mesa/mesa.inc
> > @@ -143,15 +143,16 @@ python mesa_populate_packages() {
> >  
> >      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)
> > +    if os.path.isdir(d.getVar('PKGD', True) + dri_drivers_root):
> 
> Use os.path.join instead of +
> 
> > +        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)
> >  
> >      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='')
> > -- 
> > 2.7.4
> > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 14:14   ` Martin Jansa
  2016-05-18 15:26     ` Herve Jourdain
@ 2016-05-18 15:54     ` Burton, Ross
  2016-05-18 19:39       ` Otavio Salvador
  1 sibling, 1 reply; 9+ messages in thread
From: Burton, Ross @ 2016-05-18 15:54 UTC (permalink / raw)
  To: Martin Jansa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

On 18 May 2016 at 15:14, Martin Jansa <martin.jansa@gmail.com> wrote:

> Use os.path.join instead of +
>

I just went and edited the patch directly to do that, so no need to send it
again.

Ross

[-- Attachment #2: Type: text/html, Size: 621 bytes --]

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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 15:32       ` Martin Jansa
@ 2016-05-18 19:34         ` Burton, Ross
  0 siblings, 0 replies; 9+ messages in thread
From: Burton, Ross @ 2016-05-18 19:34 UTC (permalink / raw)
  To: Martin Jansa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

On 18 May 2016 at 16:32, Martin Jansa <martin.jansa@gmail.com> wrote:

> Please ignore what I said, os.path.join won't work anyway, because
> libdir starts with slash so os.path.join would just return that part.
>

Luckily we have oe.path.join which doesn't have the os.path.join semantics,
so I changed the patch when merging into mut to use that.

Ross

[-- Attachment #2: Type: text/html, Size: 765 bytes --]

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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 15:54     ` Burton, Ross
@ 2016-05-18 19:39       ` Otavio Salvador
  2016-05-18 19:52         ` Burton, Ross
  0 siblings, 1 reply; 9+ messages in thread
From: Otavio Salvador @ 2016-05-18 19:39 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Wed, May 18, 2016 at 12:54 PM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 18 May 2016 at 15:14, Martin Jansa <martin.jansa@gmail.com> wrote:
>>
>> Use os.path.join instead of +
>
>
> I just went and edited the patch directly to do that, so no need to send it
> again.

From the previous message it seems it won't work.



-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [mesa][PATCH v2 1/1] Fix mesa_populate_packages() when dri is disabled
  2016-05-18 19:39       ` Otavio Salvador
@ 2016-05-18 19:52         ` Burton, Ross
  0 siblings, 0 replies; 9+ messages in thread
From: Burton, Ross @ 2016-05-18 19:52 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

On 18 May 2016 at 20:39, Otavio Salvador <otavio.salvador@ossystems.com.br>
wrote:

> From the previous message it seems it won't work.
>

os.path.join has the "interesting" semantics that ("/foo", "/bar") produces
"/bar", whereas oe.path.join is basically just string joining so will
produce /foo/bar.

Ross

[-- Attachment #2: Type: text/html, Size: 750 bytes --]

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

end of thread, other threads:[~2016-05-18 19:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-18 12:33 [mesa][PATCH v2 0/1] Fix mesa_populate_packages() when dri is disabled Herve Jourdain
2016-05-18 12:33 ` [mesa][PATCH v2 1/1] " Herve Jourdain
2016-05-18 14:14   ` Martin Jansa
2016-05-18 15:26     ` Herve Jourdain
2016-05-18 15:32       ` Martin Jansa
2016-05-18 19:34         ` Burton, Ross
2016-05-18 15:54     ` Burton, Ross
2016-05-18 19:39       ` Otavio Salvador
2016-05-18 19:52         ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.