Ticket #55531: npm-try-2.patch

File npm-try-2.patch, 2.8 KB (added by blair (Blair Zajac), 6 years ago)
  • devel/npm5/Portfile

    diff --git a/devel/npm5/Portfile b/devel/npm5/Portfile
    index 12ed032274..8101f70173 100644
    a b  
    33PortSystem          1.0
    44
    55name                npm5
    6 version             5.5.1
     6version             5.6.0
    77
    88categories          devel
    99platforms           darwin
    distname npm-${version} 
    2727
    2828extract.suffix      .tgz
    2929
    30 checksums           rmd160  df54fbd1fb2fcad0356ff0ec1f768418d39c599d \
    31                     sha256  b8b9afb0bb6211a289f969f66ba184ca5bc83abf6a570e0853ea5185073dca6f
     30checksums           sha1    b11e72cd5167df48b06c43474e9331fe848cb05e \
     31                    rmd160  0760654a609e113d2ee8dd77461fb560896aff08 \
     32                    sha256  b1f0de3767136c1d7b4b0f10e6eb2fb3397e2fe11e4c9cddcd0030ad1af9eddd
    3233
    3334worksrcdir          "package"
    3435
  • devel/npm5/files/patch-lib-update.js.diff

    diff --git a/devel/npm5/files/patch-lib-update.js.diff b/devel/npm5/files/patch-lib-update.js.diff
    index 3a53bd5ee7..650e119ade 100644
    a b  
    1 --- lib/update.js.orig  2016-04-26 09:35:11.000000000 +0200
    2 +++ lib/update.js       2016-04-26 09:34:24.000000000 +0200
    3 @@ -47,7 +47,12 @@
     1--- lib/update.js.orig  2017-11-27 19:37:39.000000000 -0800
     2+++ lib/update.js       2018-01-06 18:01:25.000000000 -0800
     3@@ -58,10 +58,17 @@
    44       if (url.parse(ww.req).protocol) ww.what = ww.req
    55 
    6        var where = ww.dep.parent && ww.dep.parent.path || ww.dep.path
    7 -      if (toInstall[where]) {
     6       const where = ww.dep.parent && ww.dep.parent.path || ww.dep.path
     7-      const isTransitive = !(ww.dep.requiredBy || []).some((p) => p.isTop)
     8-      const key = where + ':' + String(isTransitive)
     9-      if (!toInstall[key]) toInstall[key] = {where: where, opts: {saveOnlyLock: isTransitive}, what: []}
     10-      if (toInstall[key].what.indexOf(ww.what) === -1) toInstall[key].what.push(ww.what)
    811+      if (ww.what.match(/^npm@/) && where.match(/@@NPM_PATH_JSREGEX@@/)) {
    912+        log.error("Trying to update '" + what + "' in '" + where + "'")
    1013+        log.error("which is part of the MacPorts npm base installation.")
    1114+        log.error("To update npm please run:")
    1215+        log.error("sudo port selfupdate && sudo port upgrade npm\n")
    13 +      } else if (toInstall[where]) {
    14          toInstall[where].push(ww.what)
    15        } else {
    16          toInstall[where] = [ww.what]
     16+      } else {
     17+        const isTransitive = !(ww.dep.requiredBy || []).some((p) => p.isTop)
     18+        const key = where + ':' + String(isTransitive)
     19+        if (!toInstall[key]) toInstall[key] = {where: where, opts: {saveOnlyLock: isTransitive}, what: []}
     20+        if (toInstall[key].what.indexOf(ww.what) === -1) toInstall[key].what.push(ww.what)
     21+      }
     22     })
     23     return Bluebird.each(Object.keys(toInstall), (key) => {
     24       const deps = toInstall[key]