Quellcode durchsuchen

upgrading package: npm 6.14.8 -> 7.0.3

Ralf S. Engelschall vor 5 Jahren
Ursprung
Commit
76a524ed8f
2 geänderte Dateien mit 31 neuen und 127 gelöschten Zeilen
  1. 10 111
      npm/npm.patch
  2. 21 16
      npm/npm.spec

+ 10 - 111
npm/npm.patch

@@ -1,115 +1,14 @@
-Index: lib/config/core.js
---- lib/config/core.js.orig	2019-08-30 23:36:14.842432000 +0200
-+++ lib/config/core.js	2019-08-30 23:36:49.781204000 +0200
-@@ -291,7 +291,7 @@
-         fs.writeFile(target.path, data, 'utf8', function (er) {
-           if (er) return then(er)
-           if (myUid === 0 && (myUid !== st.uid || myGid !== st.gid)) {
--            fs.chown(target.path, st.uid, st.gid, then)
-+            then()
-           } else {
-             then()
-           }
 Index: lib/npm.js
---- lib/npm.js.orig	2019-08-22 20:56:01.000000000 +0200
-+++ lib/npm.js	2019-08-30 23:36:14.842656000 +0200
-@@ -404,9 +404,7 @@
-   Object.defineProperty(npm, 'globalDir',
-     {
-       get: function () {
--        return (process.platform !== 'win32')
--          ? path.resolve(npm.globalPrefix, 'lib', 'node_modules')
--          : path.resolve(npm.globalPrefix, 'node_modules')
-+        return path.resolve(npm.globalPrefix, 'lib', 'node', 'usr')
-       },
-       enumerable: true
-     })
-Index: lib/search/all-package-metadata.js
---- lib/search/all-package-metadata.js.orig	2019-08-22 20:56:01.000000000 +0200
-+++ lib/search/all-package-metadata.js	2019-08-30 23:36:14.842802000 +0200
-@@ -3,7 +3,6 @@
- const BB = require('bluebird')
- 
- const cacheFile = require('npm-cache-filename')
--const chownr = BB.promisify(require('chownr'))
- const correctMkdir = BB.promisify(require('../utils/correct-mkdir.js'))
- const figgyPudding = require('figgy-pudding')
- const fs = require('graceful-fs')
-@@ -233,13 +232,6 @@
- 
-     cacheFileStream.on('close', () => {
-       if (!errEmitted) {
--        if (typeof uid === 'number' &&
--            typeof gid === 'number' &&
--            process.getuid &&
--            process.getgid &&
--            (process.getuid() !== uid || process.getgid() !== gid)) {
--          chownr.sync(cacheFile, uid, gid)
--        }
-         outStream.end()
-       }
-     })
-@@ -253,9 +245,7 @@
-   var cacheBase = path.dirname(cacheFile)
-   log.silly('all-package-metadata', 'making sure cache dir exists at', cacheBase)
-   return correctMkdir(opts.cache).then(st => {
--    return mkdir(cacheBase).then(made => {
--      return chownr(made || cacheBase, st.uid, st.gid)
--    }).then(() => ({ uid: st.uid, gid: st.gid }))
-+    return mkdir(cacheBase).then(() => ({ uid: st.uid, gid: st.gid }))
-   })
- }
- 
-Index: lib/unbuild.js
---- lib/unbuild.js.orig	2019-08-22 20:56:01.000000000 +0200
-+++ lib/unbuild.js	2019-08-30 23:36:14.842918000 +0200
-@@ -98,7 +98,7 @@
-       !npm.config.get('global')) {
-     return cb()
+--- lib/npm.js.orig	2020-10-21 08:49:29.373230000 +0200
++++ lib/npm.js	2020-10-21 08:50:46.305139000 +0200
+@@ -224,9 +224,7 @@
    }
--  const manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man')
-+  const manRoot = path.resolve(npm.config.get('prefix'), 'man')
-   log.verbose('rmMans', 'man files are', pkg.man, 'in', manRoot)
-   asyncMap(pkg.man, function (man, cb) {
-     if (Array.isArray(man)) {
-Index: lib/utils/correct-mkdir.js
---- lib/utils/correct-mkdir.js.orig	2019-08-22 20:56:01.000000000 +0200
-+++ lib/utils/correct-mkdir.js	2019-08-30 23:37:01.268901000 +0200
-@@ -1,5 +1,4 @@
- // XXX this can probably be replaced with gentle-fs.mkdir everywhere it's used
--const chownr = require('chownr')
- const inflight = require('inflight')
- const log = require('npmlog')
- const mkdirp = require('mkdirp')
-@@ -28,7 +27,7 @@
-         log.error('correctMkdir', 'failed to make directory %s', path)
-         return cb(er)
-       }
--      chownr(made || path, owner.uid, owner.gid, (er) => cb(er, owner))
-+      cb(null, owner)
-     })
-   }, er => {
-     log.error('correctMkdir', 'failed to infer path ownership %s', path)
-Index: node_modules/bin-links/index.js
---- node_modules/bin-links/index.js.orig	2019-08-22 20:56:01.000000000 +0200
-+++ node_modules/bin-links/index.js	2019-08-30 23:36:14.843200000 +0200
-@@ -117,7 +117,7 @@
- function linkMans (pkg, folder, parent, gtop, opts) {
-   if (!pkg.man || !gtop || process.platform === 'win32') return
  
--  var manRoot = path.resolve(opts.prefix, 'share', 'man')
-+  var manRoot = path.resolve(opts.prefix, 'man')
-   opts.log.verbose('linkMans', 'man files are', pkg.man, 'in', manRoot)
+   get globalDir () {
+-    return process.platform !== 'win32'
+-      ? resolve(this.globalPrefix, 'lib', 'node_modules')
+-      : resolve(this.globalPrefix, 'node_modules')
++    return resolve(this.globalPrefix, 'node_modules')
+   }
  
-   // make sure that the mans are unique.
-Index: node_modules/npm-lifecycle/index.js
---- node_modules/npm-lifecycle/index.js.orig	2019-08-22 20:56:01.000000000 +0200
-+++ node_modules/npm-lifecycle/index.js	2019-08-30 23:36:14.843347000 +0200
-@@ -193,7 +193,6 @@
-   if (cfgsetting === 'warn-only') {
-     if (isDifferentNodeInPath && !shouldPrependCurrentNodeDirToPATH.hasWarned) {
-       if (foundExecPath) {
--        opts.log.warn('lifecycle', 'The node binary used for scripts is', foundExecPath, 'but npm is using', process.execPath, 'itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.')
-       } else {
-         opts.log.warn('lifecycle', 'npm is using', process.execPath, 'but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.')
-       }
+   get localDir () {

+ 21 - 16
npm/npm.spec

@@ -22,8 +22,9 @@
 ##
 
 #   package version
-%define       V_npm     6.14.8
-%define       V_node14  14.13.1
+%define       V_npm     7.0.3
+%define       V_node15  15.0.0
+%define       V_node14  14.14.0
 %define       V_node12  12.19.0
 %define       V_node10  10.22.1
 %define       V_node8   8.17.0
@@ -39,14 +40,15 @@ Class:        PLUS
 Group:        Archiver
 License:      MIT
 Version:      %{V_npm}
-Release:      20201010
+Release:      20201021
 
 #   list of sources
 Source0:      https://github.com/npm/cli/archive/v%{V_npm}.tar.gz
-Source1:      http://nodejs.org/download/release/v%{V_node14}/node-v%{V_node14}-headers.tar.gz
-Source2:      http://nodejs.org/download/release/v%{V_node12}/node-v%{V_node12}-headers.tar.gz
-Source3:      http://nodejs.org/download/release/v%{V_node10}/node-v%{V_node10}-headers.tar.gz
-Source4:      http://nodejs.org/download/release/v%{V_node8}/node-v%{V_node8}-headers.tar.gz
+Source1:      http://nodejs.org/download/release/v%{V_node15}/node-v%{V_node15}-headers.tar.gz
+Source2:      http://nodejs.org/download/release/v%{V_node14}/node-v%{V_node14}-headers.tar.gz
+Source3:      http://nodejs.org/download/release/v%{V_node12}/node-v%{V_node12}-headers.tar.gz
+Source4:      http://nodejs.org/download/release/v%{V_node10}/node-v%{V_node10}-headers.tar.gz
+Source5:      http://nodejs.org/download/release/v%{V_node8}/node-v%{V_node8}-headers.tar.gz
 Patch0:       npm.patch
 
 #   build information
@@ -63,10 +65,15 @@ PreReq:       OpenPKG, openpkg >= 20160101, node, python2
         url       = https://github.com/npm/cli/releases
         regex     = v(__VER__)\.tar\.gz
     }
+    prog npm:node15 = {
+        version   = %{V_node15}
+        url       = https://nodejs.org/download/release/
+        regex     = v(15.\d+\.\d+)
+    }
     prog npm:node14 = {
         version   = %{V_node14}
         url       = https://nodejs.org/download/release/
-        regex     = v(\d+\.\d+\.\d+)
+        regex     = v(14\.\d+\.\d+)
     }
     prog npm:node12 = {
         version   = %{V_node12}
@@ -103,11 +110,7 @@ PreReq:       OpenPKG, openpkg >= 20160101, node, python2
     %{l_shtool} subst \
         -e 's;/usr/bin/env node;%{l_prefix}/bin/node;g' \
         bin/npm-cli.js \
-        bin/npx-cli.js \
-        scripts/index-build.js \
-        node_modules/semver/bin/semver \
-        node_modules/which/bin/which \
-        node_modules/nopt/bin/nopt.js
+        bin/npx-cli.js
 
 %install
     #   create installation hierarchy
@@ -160,13 +163,15 @@ PreReq:       OpenPKG, openpkg >= 20160101, node, python2
     #   provide an unpacked verson of the Node sources
     (   cd $RPM_BUILD_ROOT%{l_prefix}/share/npm/node-gyp
         %{l_gzip} -d -c %{SOURCE1} | %{l_tar} xf -
-        mv node-v%{V_node14} %{V_node14}
+        mv node-v%{V_node15} %{V_node15}
         %{l_gzip} -d -c %{SOURCE2} | %{l_tar} xf -
-        mv node-v%{V_node12} %{V_node12}
+        mv node-v%{V_node14} %{V_node14}
         %{l_gzip} -d -c %{SOURCE3} | %{l_tar} xf -
+        mv node-v%{V_node12} %{V_node12}
+        %{l_gzip} -d -c %{SOURCE4} | %{l_tar} xf -
         mv node-v%{V_node10} %{V_node10}
         echo "9" >%{V_node10}/installVersion
-        %{l_gzip} -d -c %{SOURCE4} | %{l_tar} xf -
+        %{l_gzip} -d -c %{SOURCE5} | %{l_tar} xf -
         mv node-v%{V_node8} %{V_node8}
         echo "9" >%{V_node8}/installVersion
     ) || exit $?