diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/npm.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py index 43929ce9a3..699ae72e05 100644 --- a/bitbake/lib/bb/fetch2/npm.py +++ b/bitbake/lib/bb/fetch2/npm.py | |||
@@ -165,7 +165,9 @@ class Npm(FetchMethod): | |||
165 | pdata = json.loads('\n'.join(datalines)) | 165 | pdata = json.loads('\n'.join(datalines)) |
166 | return pdata | 166 | return pdata |
167 | 167 | ||
168 | def _getdependencies(self, pkg, data, version, d, ud, optional=False): | 168 | def _getdependencies(self, pkg, data, version, d, ud, optional=False, fetchedlist=None): |
169 | if fetchedlist is None: | ||
170 | fetchedlist = [] | ||
169 | pkgfullname = pkg | 171 | pkgfullname = pkg |
170 | if version != '*' and not '/' in version: | 172 | if version != '*' and not '/' in version: |
171 | pkgfullname += "@'%s'" % version | 173 | pkgfullname += "@'%s'" % version |
@@ -187,7 +189,9 @@ class Npm(FetchMethod): | |||
187 | outputurl = pdata['dist']['tarball'] | 189 | outputurl = pdata['dist']['tarball'] |
188 | data[pkg] = {} | 190 | data[pkg] = {} |
189 | data[pkg]['tgz'] = os.path.basename(outputurl) | 191 | data[pkg]['tgz'] = os.path.basename(outputurl) |
190 | self._runwget(ud, d, "%s --directory-prefix=%s %s" % (self.basecmd, ud.prefixdir, outputurl), False) | 192 | if not outputurl in fetchedlist: |
193 | self._runwget(ud, d, "%s --directory-prefix=%s %s" % (self.basecmd, ud.prefixdir, outputurl), False) | ||
194 | fetchedlist.append(outputurl) | ||
191 | 195 | ||
192 | dependencies = pdata.get('dependencies', {}) | 196 | dependencies = pdata.get('dependencies', {}) |
193 | optionalDependencies = pdata.get('optionalDependencies', {}) | 197 | optionalDependencies = pdata.get('optionalDependencies', {}) |
@@ -200,9 +204,9 @@ class Npm(FetchMethod): | |||
200 | else: | 204 | else: |
201 | depsfound[dep] = dependencies[dep] | 205 | depsfound[dep] = dependencies[dep] |
202 | for dep, version in optdepsfound.items(): | 206 | for dep, version in optdepsfound.items(): |
203 | self._getdependencies(dep, data[pkg]['deps'], version, d, ud, optional=True) | 207 | self._getdependencies(dep, data[pkg]['deps'], version, d, ud, optional=True, fetchedlist=fetchedlist) |
204 | for dep, version in depsfound.items(): | 208 | for dep, version in depsfound.items(): |
205 | self._getdependencies(dep, data[pkg]['deps'], version, d, ud) | 209 | self._getdependencies(dep, data[pkg]['deps'], version, d, ud, fetchedlist=fetchedlist) |
206 | 210 | ||
207 | def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest, toplevel=True): | 211 | def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest, toplevel=True): |
208 | logger.debug(2, "NPM shrinkwrap file is %s" % data) | 212 | logger.debug(2, "NPM shrinkwrap file is %s" % data) |