diff options
| -rw-r--r-- | meta/classes/npm.bbclass | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 73483cb994..c180804e0e 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass | |||
| @@ -126,11 +126,6 @@ python npm_do_configure() { | |||
| 126 | sha512 = bb.utils.sha512_file(tarball) | 126 | sha512 = bb.utils.sha512_file(tarball) |
| 127 | return "sha512-" + base64.b64encode(bytes.fromhex(sha512)).decode() | 127 | return "sha512-" + base64.b64encode(bytes.fromhex(sha512)).decode() |
| 128 | 128 | ||
| 129 | def _npm_version(tarball): | ||
| 130 | """Return the version of a specified tarball""" | ||
| 131 | regex = r"-(\d+\.\d+\.\d+(-.*)?(\+.*)?)\.tgz" | ||
| 132 | return re.search(regex, tarball).group(1) | ||
| 133 | |||
| 134 | def _npmsw_dependency_dict(orig, deptree): | 129 | def _npmsw_dependency_dict(orig, deptree): |
| 135 | """ | 130 | """ |
| 136 | Return the sub dictionary in the 'orig' dictionary corresponding to the | 131 | Return the sub dictionary in the 'orig' dictionary corresponding to the |
| @@ -191,7 +186,7 @@ python npm_do_configure() { | |||
| 191 | _npm_cache_add(tarball) | 186 | _npm_cache_add(tarball) |
| 192 | # Add its signature to the cached shrinkwrap | 187 | # Add its signature to the cached shrinkwrap |
| 193 | dep = _npmsw_dependency_dict(cached_shrinkwrap, deptree) | 188 | dep = _npmsw_dependency_dict(cached_shrinkwrap, deptree) |
| 194 | dep["version"] = _npm_version(tarball) | 189 | dep["version"] = pkg['version'] |
| 195 | dep["integrity"] = _npm_integrity(tarball) | 190 | dep["integrity"] = _npm_integrity(tarball) |
| 196 | if params.get("dev", False): | 191 | if params.get("dev", False): |
| 197 | dep["dev"] = True | 192 | dep["dev"] = True |
