[OE-core] [OE-CORE][morty]NPM and BB_NO_NETWORK

Davis, Michael michael.davis at essvote.com
Wed May 10 22:33:26 UTC 2017


I created a fix for this, but I don't know enough about the architecture / language to say if it is a good fix or an ugly hack.
Any help or suggestion would be great thanks.


diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index cd7362c..c5ab459 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -393,7 +393,8 @@ def decodeurl(url):
                     raise MalformedUrl(url, "The URL: '%s' is invalid: parameter %s does not specify a value (missing '=')" % (url, s))
                 s1, s2 = s.split('=')
                 p[s1] = s2
-
+                if type == 'npm' and s1 == 'name':
+                    path = '/' + s2
     return type, host, urllib.parse.unquote(path), user, pswd, p

---
Mike


From: Davis, Michael
Sent: Wednesday, May 10, 2017 2:47 PM
To: 'openembedded-core at lists.openembedded.org'
Subject: [OE-CORE][morty]NPM and BB_NO_NETWORK

I am having an issue with npm sources and BB_GENERATE_MIRROR_TARBALLS.
The tarballs generate fine, but then when you try to use them with prefetch only or no network the system won't find them.
It then tries to download them.   Tried it both on morty and master with the same issue.

This is my first real python experience, but I think I got it tracked down to uri_replace.

Example debug line of a working git replace vs a non working npm one.

DEBUG: For url ['git', 'git.yoctoproject.org', '/psplash', '', '', OrderedDict()] comparing ['git', '.*', '/.*', '', '', OrderedDict()] to ['file', '', '/build/downloads/', '', '', OrderedDict()]
DEBUG: For url git://git.yoctoproject.org/psplash returning file:///build/downloads/git2_git.yoctoproject.org.psplash.tar.gz<file:///\\build\downloads\git2_git.yoctoproject.org.psplash.tar.gz>

DEBUG: For url ['npm', 'registry.npmjs.org', '', '', '', OrderedDict([('name', 'nopt'), ('version', '3.0.6'), ('subdir', 'node_modules/nopt')])] comparing ['npm', '.*', '/.*', '', '', OrderedDict()] to ['file', '', '/build/downloads/', '', '', OrderedDict()]

Don't know if maybe the OrderedDict vs the path is causing the issue or not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170510/4950b420/attachment-0002.html>


More information about the Openembedded-core mailing list