[arch-commits] Commit in npm/trunk (PKGBUILD)

Eli Schwartz eschwartz at archlinux.org
Wed Apr 11 18:37:27 UTC 2018


    Date: Wednesday, April 11, 2018 @ 18:37:26
  Author: eschwartz
Revision: 315740

upgpkg: npm 5.8.0-2

Fix deduplication. Clean up junk symlinks in .bin/ and fix some paths for node-gyp.
Fixes FS#58129 and FS#56975

Modified:
  npm/trunk/PKGBUILD

----------+
 PKGBUILD |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-04-11 18:15:36 UTC (rev 315739)
+++ PKGBUILD	2018-04-11 18:37:26 UTC (rev 315740)
@@ -3,7 +3,7 @@
 
 pkgname=npm
 pkgver=5.8.0
-pkgrel=1
+pkgrel=2
 pkgdesc='A package manager for javascript'
 arch=('any')
 url='https://www.npmjs.com/'
@@ -28,12 +28,17 @@
   cd npm-$pkgver
   make NPMOPTS="--prefix=\"$pkgdir/usr\"" install
 
-  # Why 777? :/
+  # Non-deterministic race in npm gives 777 permissions to random directories.
+  # See https://github.com/npm/npm/issues/9359 for details.
   chmod -R u=rwX,go=rX "$pkgdir"
 
   # Experimental dedup
-  rm -r "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules/semver
-  rm -r "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules/npm-lifecycle/node_modules/node-gyp
+  _npmdir="$pkgdir"/usr/lib/node_modules/$pkgname
+  rm -r "$_npmdir"/node_modules/{,.bin/}semver
+  rm -r "$_npmdir"/node_modules/npm-lifecycle/node_modules/{,.bin/}node-gyp
+  sed -i '/node-gyp.js/c\  exec /usr/bin/node-gyp "$@"' \
+    "$_npmdir"/node_modules/npm-lifecycle/node-gyp-bin/node-gyp \
+    "$_npmdir"/bin/node-gyp-bin/node-gyp
 
   install -dm755 "$pkgdir"/usr/share/bash-completion/completions
   node "$srcdir"/npm-$pkgver/bin/npm-cli.js completion > "$pkgdir"/usr/share/bash-completion/completions/npm



More information about the arch-commits mailing list