Skip to contentSkip to conversation

pango: don't try to split modules if none were installed

PATCH In review Phil Blundell 2 participants 3 messages Sep 30, 2012 – Oct 12, 2012 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pango: don't try to split modules if none were installed

If pango is configured --with-included-modules then the modules directory may not exist. Trying to call do_split_modules() on a nonexistent path leads to python stack traceback spew and a build failure, so check in advance whether that directory is present before trying to do any splitting.

---
v2: can't use os.path.join() with modules_root as 2nd argument

 meta/recipes-graphics/pango/pango.inc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
meta/recipes-graphics/pango/pango.inc +3 -2
index c9e92f0..18ee068 100644
@@ -64,8 +64,9 @@ python populate_packages_prepend () {
     prologue = d.getVar("postinst_prologue", True)
 
     modules_root = d.expand('${libdir}/pango/${LIBV}/modules')
-
-    do_split_packages(d, modules_root, '^pango-(.*)\.so$', 'pango-module-%s', 'Pango module %s', prologue + '${bindir}/${MLPREFIX}pango-querymodules > /etc/pango/${MLPREFIX}pango.modules')
+    
+    if os.path.exists(d.expand('${WORKDIR}/package') + modules_root):
+       do_split_packages(d, modules_root, '^pango-(.*)\.so$', 'pango-module-%s', 'Pango module %s', prologue + '${bindir}/${MLPREFIX}pango-querymodules > /etc/pango/${MLPREFIX}pango.modules')
 }
 
 FILES_${PN} = "${sysconfdir}/pango/* ${bindir}/* ${libdir}/libpango*${SOLIBS}"
Signature · 1 line
1.7.9

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 2 lines · Ross Burton

As this keeps on cropping up, I did have a patch to do_split_packages that added an allow-empty argument. Might be worth digging out.

Sounds like a decent plan.

p.

#3 lore raw
Quoted 5 lines · Phil Blundell
Quoted 2 lines · Ross Burton

As this keeps on cropping up, I did have a patch to do_split_packages that added an allow-empty argument. Might be worth digging out.

Sounds like a decent plan.

So do_split_packages() effectively has this if you set recursive=True, as os.walk() returns an empty list if you pass it a non-existent directory (it's documented as ignoring errors from os.listdir).

So, what is the behaviour do_split_packages() should have if the split root doesn't exist - should it error, ignore, or there be an option?

(note that pre-automake 1.12 this rarely happened because the directory would exist but be empty, now with 1.12 it doesn't install empty directories)

Ross