summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>2020-01-24 18:07:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-27 16:48:09 +0000
commit3b0640c993c5e961c010a63bd2b340a28ca350c9 (patch)
tree93733d3b672b4155d397a82989df09c7d883882a /meta/lib/oe
parentcfa5544005a37df684463367eab7f4cf376cd1a9 (diff)
downloadpoky-3b0640c993c5e961c010a63bd2b340a28ca350c9.tar.gz
lib/oe/package: remove unneeded npm_split_package_dirs function
The npm_split_package_dirs function was used by the recipetool when creating npm recipes. This is not the case anymore. (From OE-Core rev: 6cd834737eaa42592e83300099c152e2cfef568c) Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index b8585d4253..dd700cbb0c 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -283,36 +283,3 @@ def read_shlib_providers(d):
283 shlib_provider[s[0]] = {} 283 shlib_provider[s[0]] = {}
284 shlib_provider[s[0]][s[1]] = (dep_pkg, s[2]) 284 shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
285 return shlib_provider 285 return shlib_provider
286
287
288def npm_split_package_dirs(pkgdir):
289 """
290 Work out the packages fetched and unpacked by BitBake's npm fetcher
291 Returns a dict of packagename -> (relpath, package.json) ordered
292 such that it is suitable for use in PACKAGES and FILES
293 """
294 from collections import OrderedDict
295 import json
296 packages = {}
297 for root, dirs, files in os.walk(pkgdir):
298 if os.path.basename(root) == 'node_modules':
299 for dn in dirs:
300 relpth = os.path.relpath(os.path.join(root, dn), pkgdir)
301 pkgitems = ['${PN}']
302 for pathitem in relpth.split('/'):
303 if pathitem == 'node_modules':
304 continue
305 pkgitems.append(pathitem)
306 pkgname = '-'.join(pkgitems).replace('_', '-')
307 pkgname = pkgname.replace('@', '')
308 pkgfile = os.path.join(root, dn, 'package.json')
309 data = None
310 if os.path.exists(pkgfile):
311 with open(pkgfile, 'r') as f:
312 data = json.loads(f.read())
313 packages[pkgname] = (relpth, data)
314 # We want the main package for a module sorted *after* its subpackages
315 # (so that it doesn't otherwise steal the files for the subpackage), so
316 # this is a cheap way to do that whilst still having an otherwise
317 # alphabetical sort
318 return OrderedDict((key, packages[key]) for key in sorted(packages, key=lambda pkg: pkg + '~'))