diff options
author | Martin Jansa <martin.jansa@lge.com> | 2015-06-23 14:35:33 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-07-16 21:09:05 +0200 |
commit | c6eef3a0c1967894e96dbbe20c20b3b99f5cb5da (patch) | |
tree | 95bc474c35516514c4dea2eacfc3d3414bb3739d /meta-oe/recipes-devtools/nodejs | |
parent | e836f8f936f1a39e8b29c08a5979919d9e04cbde (diff) | |
download | meta-openembedded-c6eef3a0c1967894e96dbbe20c20b3b99f5cb5da.tar.gz |
nodejs: fix no-registry option
* https://github.com/npm/npm/issues/3691
* https://github.com/npm/npm/issues/5509
Signed-off-by: Martin Jansa <martin.jansa@lge.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs')
-rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/no-registry.patch | 59 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_0.12.4.bb | 1 |
2 files changed, 60 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/no-registry.patch b/meta-oe/recipes-devtools/nodejs/nodejs/no-registry.patch new file mode 100644 index 0000000000..ed24738976 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/no-registry.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | Bugfix for --no-registry in nodejs-v0.12.2 | ||
2 | |||
3 | diff -u -r node-v0.12.2_def/deps/npm/lib/cache/caching-client.js node-v0.12.2/deps/npm/lib/cache/caching-client.js | ||
4 | --- node-v0.12.2_def/deps/npm/lib/cache/caching-client.js 2015-04-01 01:13:01.000000000 +0300 | ||
5 | +++ node-v0.12.2/deps/npm/lib/cache/caching-client.js 2015-05-18 00:47:10.738599686 +0300 | ||
6 | @@ -67,6 +67,22 @@ | ||
7 | var cacheBase = cacheFile(npm.config.get("cache"))(uri) | ||
8 | var cachePath = path.join(cacheBase, ".cache.json") | ||
9 | |||
10 | + if (parsed.host === "noregistry") (function() { | ||
11 | + var stat = null | ||
12 | + var file = npm.config.get("cache") + parsed.pathname + "/.cache.json" | ||
13 | + try { | ||
14 | + stat = fs.statSync(cachePath) | ||
15 | + } catch (ex) {} | ||
16 | + if (!stat) try { | ||
17 | + stat = fs.statSync(file) | ||
18 | + cachePath = file | ||
19 | + } catch (ex) { | ||
20 | + stat = "Registry not defined and registry files not found: \"" + | ||
21 | + cachePath + "\", \"" + file + "\"." | ||
22 | + throw new Error(stat) | ||
23 | + } | ||
24 | + })() | ||
25 | + | ||
26 | // If the GET is part of a write operation (PUT or DELETE), then | ||
27 | // skip past the cache entirely, but still save the results. | ||
28 | if (uri.match(/\?write=true$/)) { | ||
29 | @@ -83,12 +99,17 @@ | ||
30 | } | ||
31 | catch (ex) { | ||
32 | data = null | ||
33 | + if (parsed.host === "noregistry") | ||
34 | + throw new Error("File \"" + cachePath+"\"" + " corrupted.") | ||
35 | } | ||
36 | |||
37 | params.stat = stat | ||
38 | params.data = data | ||
39 | |||
40 | - get_.call(client, uri, cachePath, params, cb) | ||
41 | + if (parsed.host === "noregistry") | ||
42 | + cb(null, data, JSON.stringify(data), { statusCode : 304 }) | ||
43 | + else | ||
44 | + get_.call(client, uri, cachePath, params, cb) | ||
45 | }) | ||
46 | } | ||
47 | else { | ||
48 | diff -u -r node-v0.12.2_def/deps/npm/lib/utils/map-to-registry.js node-v0.12.2/deps/npm/lib/utils/map-to-registry.js | ||
49 | --- node-v0.12.2_def/deps/npm/lib/utils/map-to-registry.js 2015-04-01 01:13:01.000000000 +0300 | ||
50 | +++ node-v0.12.2/deps/npm/lib/utils/map-to-registry.js 2015-05-18 01:15:10.030569613 +0300 | ||
51 | @@ -45,6 +45,8 @@ | ||
52 | |||
53 | log.silly("mapToRegistry", "registry", registry) | ||
54 | |||
55 | + if (!registry) return cb(null, "http://noregistry/" + name, {}) | ||
56 | + | ||
57 | var auth = config.getCredentialsByURI(registry) | ||
58 | |||
59 | // normalize registry URL so resolution doesn't drop a piece of registry URL | ||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_0.12.4.bb b/meta-oe/recipes-devtools/nodejs/nodejs_0.12.4.bb index 81b8c0d238..cc4a5ceba6 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_0.12.4.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_0.12.4.bb | |||
@@ -7,6 +7,7 @@ DEPENDS = "openssl" | |||
7 | 7 | ||
8 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz \ | 8 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz \ |
9 | file://enable-armv5e-build.patch \ | 9 | file://enable-armv5e-build.patch \ |
10 | file://no-registry.patch \ | ||
10 | " | 11 | " |
11 | SRC_URI[md5sum] = "c2b4deea212c0b7c2f86368c65fab312" | 12 | SRC_URI[md5sum] = "c2b4deea212c0b7c2f86368c65fab312" |
12 | SRC_URI[sha256sum] = "3298d0997613a04ac64343e8316da134d04588132554ae402eb344e3369ec912" | 13 | SRC_URI[sha256sum] = "3298d0997613a04ac64343e8316da134d04588132554ae402eb344e3369ec912" |