Package: npm2deb
Version: 0.2.7-6
Severity: normal
Tags: patch

Dear Maintainer,

While trying to use npm2deb with my prototype package form npm 6.0.1 I
discovered newer versions of npm report more warning messages

so Npm2Deb.download() was failing with a filename to long error message because
npm pack now reports extra information:

$ npm pack cmd-shim
npm notice
npm notice 📦  cmd-shim@2.0.2
npm notice === Tarball Contents ===
npm notice 444B  package.json
npm notice 98B   .npmignore
npm notice 1.1kB README.md
npm notice 1.3kB LICENSE
npm notice 4.6kB index.js
npm notice 47B   .travis.yml
npm notice 861B  test/00-setup.js
npm notice 6.0kB test/basic.js
npm notice 277B  test/zz-cleanup.js
npm notice === Tarball Details ===
npm notice name:          cmd-shim
npm notice version:       2.0.2
npm notice filename:      cmd-shim-2.0.2.tgz
npm notice package size:  5.1 kB
npm notice unpacked size: 14.8 kB
npm notice shasum:        6fcbda99483a8fd15d7d30a196ca69d688a2efdb
npm notice integrity:     sha512-NLt0ntM0kvuSN[...]p1WI00eetDYzw==
npm notice total files:   9
npm notice
cmd-shim-2.0.2.tgz


A pretty simple solution is instead to do "npm pack -q cmd-shim" which just
prints the tgz file name as expected.

I tested on stretch and npm 1.4.21+ds-2 support npm pack -q

Diane



-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'stable-debug'), (500, 'testing'), 
(500, 'stable'), (110, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.16.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages npm2deb depends on:
ii  devscripts                2.18.3
ii  node-github-url-from-git  1.4.0-1
ii  npm                       6.0.1+ds-1
ii  python3                   3.6.5-3
ii  python3-dateutil          2.6.1-1

npm2deb recommends no packages.

npm2deb suggests no packages.

-- no debconf information
>From f51da497495a48aaf33d2c686b4e0f02fc2e8929 Mon Sep 17 00:00:00 2001
From: Diane Trout <di...@ghic.org>
Date: Fri, 8 Jun 2018 20:08:39 -0700
Subject: [PATCH] Force quiet mode on download

---
 npm2deb/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
index 3f7c187..e508803 100644
--- a/npm2deb/__init__.py
+++ b/npm2deb/__init__.py
@@ -397,7 +397,7 @@ and may not include tests.\n""")
 
     def download(self):
         utils.debug(1, "downloading %s tarball from npm registry" % self.name)
-        info = _getstatusoutput('npm pack "%s"' % self.name)
+        info = _getstatusoutput('npm pack -q "%s"' % self.name)
         if info[0] is not 0:
             exception = "Error downloading package %s\n" % self.name
             exception += info[1]
-- 
2.17.1

Reply via email to