]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2/npm: fix errors with some version specifications
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 9 Mar 2016 04:22:12 +0000 (17:22 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Mar 2016 22:37:27 +0000 (22:37 +0000)
"2 || 3" is a valid version specification for a dependency in an npm
package.json file, but of course that looks like something else when
sent to a shell. Quote the version value to avoid this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/npm.py

index 457043f3048c0986858bad1abd41e825437ed4bb..df27669c581463eafe5cc0a6e5b4d41da7debe83 100644 (file)
@@ -145,7 +145,7 @@ class Npm(FetchMethod):
     def _getdependencies(self, pkg, data, version, d, ud):
         pkgfullname = pkg
         if version != '*' and not '/' in version:
-            pkgfullname += "@%s" % version
+            pkgfullname += "@'%s'" % version
         logger.debug(2, "Calling getdeps on %s" % pkg)
         fetchcmd = "npm view %s dist.tarball --registry %s" % (pkgfullname, ud.registry)
         output = runfetchcmd(fetchcmd, d, True)