From 69e20cade69af6b7563581a6f03e95667ab09c43 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 12 Apr 2016 10:58:39 +0100 Subject: npm.bbclass: Stop packagenames containing underscores from being generated Package names cannot contain underscores yet some npm modules use them as part of the name, replace them with hyphens in the package name. (From OE-Core rev: fea932c79c8201e3e7649f4443874ea540e33461) Signed-off-by: Brendan Le Foll Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/npm.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'meta/classes') diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 33ff5e3f45..9843e87350 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -28,7 +28,9 @@ python populate_packages_prepend () { for pkgname in pkgnames: pkgrelpath, pdata = extrapackages[pkgname] pkgpath = '${libdir}/node_modules/${PN}/' + pkgrelpath - expanded_pkgname = d.expand(pkgname) + # package names can't have underscores but npm packages sometimes use them + oe_pkg_name = pkgname.replace('_', '-') + expanded_pkgname = d.expand(oe_pkg_name) d.setVar('FILES_%s' % expanded_pkgname, pkgpath) if pdata: version = pdata.get('version', None) @@ -37,7 +39,7 @@ python populate_packages_prepend () { description = pdata.get('description', None) if description: d.setVar('SUMMARY_%s' % expanded_pkgname, description.replace(u"\u2018", "'").replace(u"\u2019", "'").encode("utf8")) - d.appendVar('RDEPENDS_%s' % d.getVar('PN', True), ' %s' % ' '.join(pkgnames)) + d.appendVar('RDEPENDS_%s' % d.getVar('PN', True), ' %s' % ' '.join(pkgnames).replace('_', '-')) } FILES_${PN} += " \ -- cgit v1.2.3-54-g00ecf