summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2022-05-19 12:05:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-28 12:55:26 +0100
commit3a4c11f2c733c6a9b652410d55495c7ae7eebf57 (patch)
treeaab41d05ff50dd4ee5ef72113dc728479bd89fd6
parent6853b9b7d5f86c8080fe9a09811f57a411c74deb (diff)
downloadpoky-3a4c11f2c733c6a9b652410d55495c7ae7eebf57.tar.gz
npm: return content of 'package.json' in 'npm_pack'
We have to read 'package.json' to calculate the name of the tarball. This content is interesting for later patches. (From OE-Core rev: d67367e389c492ae90f9021066d6a4d5ebcf68e5) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/npm.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index 492935a85e..73483cb994 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -86,7 +86,7 @@ def npm_pack(env, srcdir, workdir):
86 '.'], 86 '.'],
87 check = True, cwd = srcdir) 87 check = True, cwd = srcdir)
88 88
89 return tarball 89 return (tarball, j)
90 90
91python npm_do_configure() { 91python npm_do_configure() {
92 """ 92 """
@@ -187,7 +187,7 @@ python npm_do_configure() {
187 with tempfile.TemporaryDirectory() as tmpdir: 187 with tempfile.TemporaryDirectory() as tmpdir:
188 # Add the dependency to the npm cache 188 # Add the dependency to the npm cache
189 destdir = os.path.join(d.getVar("S"), destsuffix) 189 destdir = os.path.join(d.getVar("S"), destsuffix)
190 tarball = npm_pack(env, destdir, tmpdir) 190 (tarball, pkg) = npm_pack(env, destdir, tmpdir)
191 _npm_cache_add(tarball) 191 _npm_cache_add(tarball)
192 # Add its signature to the cached shrinkwrap 192 # Add its signature to the cached shrinkwrap
193 dep = _npmsw_dependency_dict(cached_shrinkwrap, deptree) 193 dep = _npmsw_dependency_dict(cached_shrinkwrap, deptree)
@@ -208,7 +208,7 @@ python npm_do_configure() {
208 208
209 # Configure the main package 209 # Configure the main package
210 with tempfile.TemporaryDirectory() as tmpdir: 210 with tempfile.TemporaryDirectory() as tmpdir:
211 tarball = npm_pack(env, d.getVar("S"), tmpdir) 211 (tarball, _) = npm_pack(env, d.getVar("S"), tmpdir)
212 npm_unpack(tarball, d.getVar("NPM_PACKAGE"), d) 212 npm_unpack(tarball, d.getVar("NPM_PACKAGE"), d)
213 213
214 # Configure the cached manifest file and cached shrinkwrap file 214 # Configure the cached manifest file and cached shrinkwrap file
@@ -282,7 +282,7 @@ python npm_do_compile() {
282 args.append(("build-from-source", "true")) 282 args.append(("build-from-source", "true"))
283 283
284 # Pack and install the main package 284 # Pack and install the main package
285 tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir) 285 (tarball, _) = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)
286 cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM")) 286 cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM"))
287 env.run(cmd, args=args) 287 env.run(cmd, args=args)
288} 288}