Daniel M. Capella pushed to branch main at Arch Linux / Packaging / Packages / 
npm


Commits:
8015bb0b by Daniel M. Capella at 2024-08-29T01:36:28-04:00
upgpkg: 10.8.3-1: Also adjust man page workarounds

The test run was rebuilding the docs and negating the workaround in build(), so
move it to package() and remove the superfluous doc build.

- - - - -


2 changed files:

- .SRCINFO
- PKGBUILD


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,6 +1,6 @@
 pkgbase = npm
        pkgdesc = JavaScript package manager
-       pkgver = 10.8.2
+       pkgver = 10.8.3
        pkgrel = 1
        url = https://www.npmjs.com
        arch = any
@@ -11,7 +11,7 @@ pkgbase = npm
        depends = nodejs-nopt
        depends = semver
        optdepends = git: for dependencies using Git URL's
-       source = npm-cli::git+https://github.com/npm/cli.git#tag=v10.8.2
-       b2sums = 
e1650bfb9f95c411aca6bd26002500bdee3f8f736326c9d4a10298f752ca232ba48a8088069eca99dd0120cf65db1ad53799b2470aef158dfdc360aad86699cb
+       source = npm-cli::git+https://github.com/npm/cli.git#tag=v10.8.3
+       b2sums = 
18f8a50b41321879b7ed6d1697cda2eae05a5578099344c805cc9c8de211919622d60a6d3a693d359b29e08ee689675ec986db2147038d286ee971fcb7ea8baa
 
 pkgname = npm


=====================================
PKGBUILD
=====================================
@@ -2,7 +2,7 @@
 # Contributor: Felix Yan <[email protected]>
 
 pkgname=npm
-pkgver=10.8.2
+pkgver=10.8.3
 pkgrel=1
 pkgdesc='JavaScript package manager'
 arch=(any)
@@ -17,24 +17,11 @@ depends=(
 makedepends=(git)
 optdepends=("git: for dependencies using Git URL's")
 source=("npm-cli::git+https://github.com/npm/cli.git#tag=v$pkgver";)
-b2sums=('e1650bfb9f95c411aca6bd26002500bdee3f8f736326c9d4a10298f752ca232ba48a8088069eca99dd0120cf65db1ad53799b2470aef158dfdc360aad86699cb')
+b2sums=('18f8a50b41321879b7ed6d1697cda2eae05a5578099344c805cc9c8de211919622d60a6d3a693d359b29e08ee689675ec986db2147038d286ee971fcb7ea8baa')
 
 build() {
   cd npm-cli
   node scripts/resetdeps.js
-  node . run build -w docs
-
-  # Workaround for https://github.com/npm/cli/issues/780
-  cd man
-  local f name sec title
-  for f in man5/folders.5 man5/install.5 man7/*.7; do
-    sec=${f##*.}
-    name=$(basename "$f" ."$sec")
-    title=$(echo "$name" | tr '[:lower:]' '[:upper:]')
-
-    sed -Ei "s/^\.TH \"$title\"/.TH \"NPM-$title\"/" "$f"
-    mv "$f" "${f%/*}/npm-$name.$sec"
-  done
 }
 
 check() {
@@ -47,6 +34,7 @@ check() {
 
 package() {
   local mod_dir=/usr/lib/node_modules/$pkgname
+
   install -d 
"$pkgdir"/usr/share/{bash-completion/completions,licenses/$pkgname}
   ln -s $mod_dir/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 
@@ -55,18 +43,32 @@ package() {
   node . completion > "$pkgdir"/usr/share/bash-completion/completions/npm
   echo 'globalconfig=/etc/npmrc' > "$pkgdir"/$mod_dir/npmrc
 
-  cd "$pkgdir"
+  cd "$pkgdir"/$mod_dir
   # Remove superfluous scripts
-  rm -r ./$mod_dir/{bin/{node-gyp-bin,np{m,x}{,.{cmd,ps1}}},node_modules/.bin}
+  rm -r {bin/{node-gyp-bin,np{m,x}{,.{cmd,ps1}}},node_modules/.bin}
 
   # Experimental dedup
-  rm -r ./$mod_dir/node_modules/{node-gyp,nopt,semver}
+  rm -r node_modules/{node-gyp,nopt,semver}
+
+  cd man
+  # Workaround for https://github.com/npm/cli/issues/780
+  local name page sec title
+  for page in man5/folders.5 man5/install.5 man7/*.7; do
+    sec=${page##*.}
+    name=$(basename "$page" ."$sec")
+    title=${name@U}
+
+    sed -Ei "s/^\.TH \"$title\"/.TH \"NPM-$title\"/" "$page"
+    mv "$page" "${page/\///npm-}"
+  done
+
+  gzip man?/*
 
   # Support both `man` and `npm help`
-  for mandir in ./"$mod_dir"/man/man?; do
-    local dst=usr/share/man/"$(basename "$mandir")"
-    gzip "$mandir"/*
-    install -d "$dst"
-    ln -r -s "$mandir"/* "$dst"
+  local dest sec_dir
+  for sec_dir in man?; do
+    dest="$pkgdir"/usr/share/man/$sec_dir
+    install -d "$dest"
+    ln -r -s "$sec_dir"/* "$dest"
   done
 }



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/npm/-/commit/8015bb0bae52543f7615ebbc492574c8920c7565

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/npm/-/commit/8015bb0bae52543f7615ebbc492574c8920c7565
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to