[Pkg-javascript-commits] [npm2deb] 01/03: Imported Upstream version 0.1.2

Leo Iannacone l3on-guest at moszumanska.debian.org
Mon May 12 08:19:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

l3on-guest pushed a commit to branch master
in repository npm2deb.

commit 3741c5299dd23baa6226967b4079d106023cad71
Author: Leo Iannacone <l3on at ubuntu.com>
Date:   Mon May 12 10:18:37 2014 +0200

    Imported Upstream version 0.1.2
---
 npm2deb.py           | 6 +++++-
 npm2deb/__init__.py  | 4 ++--
 npm2deb/helper.py    | 2 ++
 npm2deb/scripts.py   | 6 ++++--
 npm2deb/templates.py | 4 +++-
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/npm2deb.py b/npm2deb.py
index d970fcb..f670f81 100755
--- a/npm2deb.py
+++ b/npm2deb.py
@@ -3,4 +3,8 @@
 import sys
 from npm2deb.scripts import main
 
-sys.exit(main(sys.argv))
+try:
+    sys.exit(main(sys.argv))
+except KeyboardInterrupt:
+    print("")
+    pass
diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
index 100cedf..bb2d710 100644
--- a/npm2deb/__init__.py
+++ b/npm2deb/__init__.py
@@ -16,7 +16,7 @@ except ImportError:
 from npm2deb import utils, templates
 from npm2deb.mapper import Mapper
 
-VERSION = '0.1.1'
+VERSION = '0.1.2'
 DEBHELPER = 8
 STANDARDS_VERSION = '3.9.5'
 
@@ -252,7 +252,7 @@ class Npm2Deb(object):
         utils.create_debian_file("compat", self.debian_debhelper)
 
     def read_package_info(self):
-        utils.debug(1, "reading package info using npm view")
+        utils.debug(1, "reading json - calling npm view %s" % self.name)
         info = getstatusoutput('npm view "%s" --json 2>/dev/null' % self.name)
         # if not status 0, raise expection
         if info[0] != 0:
diff --git a/npm2deb/helper.py b/npm2deb/helper.py
index c759832..5edd4d7 100644
--- a/npm2deb/helper.py
+++ b/npm2deb/helper.py
@@ -111,6 +111,7 @@ def search_for_dependencies(module, recursive=False, force=False,
                             prefix=u'', expanded_dependencies=[]):
     try:
         if not isinstance(module, Npm2Deb):
+            debug(1, 'getting dependencies - calling npm view %s' % module)
             npm_out = getstatusoutput('npm view "%s" '
                                       'dependencies --json 2>/dev/null'
                                       % module)[1]
@@ -153,6 +154,7 @@ def search_for_dependencies(module, recursive=False, force=False,
 def search_for_builddep(module):
     try:
         if not isinstance(module, Npm2Deb):
+            debug(1, 'getting builddep - calling npm view %s' % module)
             npm_out = getstatusoutput('npm view "%s" '
                                       'devDependencies --json 2>/dev/null'
                                       % module)[1]
diff --git a/npm2deb/scripts.py b/npm2deb/scripts.py
index 75c2128..cf2c873 100644
--- a/npm2deb/scripts.py
+++ b/npm2deb/scripts.py
@@ -8,12 +8,14 @@ from subprocess import call
 import os
 import sys
 
+
 def main(argv=None):
     if not argv:
         argv = sys.argv
     parser = ArgumentParser(prog='npm2deb')
     parser.add_argument('-D', '--debug', type=int, help='set debug level')
-    parser.add_argument('-v', '--version', action='version', \
+    parser.add_argument(
+        '-v', '--version', action='version',
         version='%(prog)s ' + VERSION)
 
     subparsers = parser.add_subparsers(title='commands')
@@ -233,7 +235,7 @@ def show_dependencies(args):
         if 'devDependencies' in json and json['devDependencies']:
             print "Build dependencies:"
             helper.print_formatted_dependency("NPM", "Debian")
-            helper.search_for_builddep(module_name)
+            helper.search_for_builddep(npm2deb_instance)
             print("")
         else:
             print("Module %s has no build dependencies." % module_name)
diff --git a/npm2deb/templates.py b/npm2deb/templates.py
index ac550e8..1c93a45 100644
--- a/npm2deb/templates.py
+++ b/npm2deb/templates.py
@@ -257,6 +257,8 @@ LICENSES['Expat'] = """Expat
 """
 
 WATCH_GITHUB = """version=3
-opts=filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/%(debian_name)s-$1.tar.gz/ \\
+opts=\\
+dversionmangle=s/\?(debian|dfsg|ds|deb)\d*$//,\\
+filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/%(debian_name)s-$1.tar.gz/ \\
  %(homepage)s/tags .*/archive/v?([\d\.]+).tar.gz
 """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/npm2deb.git



More information about the Pkg-javascript-commits mailing list