[bitbake-devel] [PATCH 1/3] fetch2/npm: fix errors with some version specifications

Paul Eggleton paul.eggleton at linux.intel.com
Wed Mar 9 04:22:12 UTC 2016


"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 at linux.intel.com>
---
 lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py
index 457043f..df27669 100644
--- a/lib/bb/fetch2/npm.py
+++ b/lib/bb/fetch2/npm.py
@@ -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)
-- 
2.5.0




More information about the bitbake-devel mailing list