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