diff options
| author | Enrico Scholz <enrico.scholz@sigma-chemnitz.de> | 2022-05-19 12:05:52 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-12 08:41:48 +0100 |
| commit | 54962ac3a96214daa1d3c84c9b5c02ea4fb1783d (patch) | |
| tree | e6c5f11b6a02069d394d98476097c1b619f65f29 /meta/classes | |
| parent | c5feaa512036a4c855547c5261c68b0828cf9e16 (diff) | |
| download | poky-54962ac3a96214daa1d3c84c9b5c02ea4fb1783d.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: 2f5c53745b4420dac9198ec013c6653b3e339a6b)
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d67367e389c492ae90f9021066d6a4d5ebcf68e5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/npm.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 91f8f36b0d..014f793450 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 | ||
| 91 | python npm_do_configure() { | 91 | python npm_do_configure() { |
| 92 | """ | 92 | """ |
| @@ -186,7 +186,7 @@ python npm_do_configure() { | |||
| 186 | with tempfile.TemporaryDirectory() as tmpdir: | 186 | with tempfile.TemporaryDirectory() as tmpdir: |
| 187 | # Add the dependency to the npm cache | 187 | # Add the dependency to the npm cache |
| 188 | destdir = os.path.join(d.getVar("S"), destsuffix) | 188 | destdir = os.path.join(d.getVar("S"), destsuffix) |
| 189 | tarball = npm_pack(env, destdir, tmpdir) | 189 | (tarball, pkg) = npm_pack(env, destdir, tmpdir) |
| 190 | _npm_cache_add(tarball) | 190 | _npm_cache_add(tarball) |
| 191 | # Add its signature to the cached shrinkwrap | 191 | # Add its signature to the cached shrinkwrap |
| 192 | dep = _npmsw_dependency_dict(cached_shrinkwrap, deptree) | 192 | dep = _npmsw_dependency_dict(cached_shrinkwrap, deptree) |
| @@ -207,7 +207,7 @@ python npm_do_configure() { | |||
| 207 | 207 | ||
| 208 | # Configure the main package | 208 | # Configure the main package |
| 209 | with tempfile.TemporaryDirectory() as tmpdir: | 209 | with tempfile.TemporaryDirectory() as tmpdir: |
| 210 | tarball = npm_pack(env, d.getVar("S"), tmpdir) | 210 | (tarball, _) = npm_pack(env, d.getVar("S"), tmpdir) |
| 211 | npm_unpack(tarball, d.getVar("NPM_PACKAGE"), d) | 211 | npm_unpack(tarball, d.getVar("NPM_PACKAGE"), d) |
| 212 | 212 | ||
| 213 | # Configure the cached manifest file and cached shrinkwrap file | 213 | # Configure the cached manifest file and cached shrinkwrap file |
| @@ -280,7 +280,7 @@ python npm_do_compile() { | |||
| 280 | args.append(("build-from-source", "true")) | 280 | args.append(("build-from-source", "true")) |
| 281 | 281 | ||
| 282 | # Pack and install the main package | 282 | # Pack and install the main package |
| 283 | tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir) | 283 | (tarball, _) = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir) |
| 284 | cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM")) | 284 | cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM")) |
| 285 | env.run(cmd, args=args) | 285 | env.run(cmd, args=args) |
| 286 | } | 286 | } |
