[Pkg-javascript-commits] [npm2deb] 01/01: imported patch from git - preventing infite loop when looks for dependencies

Leo Iannacone l3on-guest at moszumanska.debian.org
Tue May 6 08:19:21 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 ee77ce32315496bd886eb934b43ee982ad3fe878
Author: Leo Iannacone <l3on at ubuntu.com>
Date:   Tue May 6 10:19:15 2014 +0200

    imported patch from git - preventing infite loop when looks for dependencies
---
 debian/changelog                                   |  2 +-
 debian/patches/git_fix-prevent-infinite-loop.patch | 35 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 26403b9..7d6d31e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-npm2deb (0.1.0-1) UNRELEASED; urgency=low
+npm2deb (0.1.0-1) unstable; urgency=low
 
   * Initial release (Closes: #746752)
 
diff --git a/debian/patches/git_fix-prevent-infinite-loop.patch b/debian/patches/git_fix-prevent-infinite-loop.patch
new file mode 100644
index 0000000..cdaa365
--- /dev/null
+++ b/debian/patches/git_fix-prevent-infinite-loop.patch
@@ -0,0 +1,35 @@
+commit 1ead94ec07e8cf6c9b39c1b02f2f1c792dd443c5
+Author: Leo Iannacone <l3on at ubuntu.com>
+Date:   Tue May 6 10:01:29 2014 +0200
+
+    prevent infinite loop when looking recursively for dependencies
+
+diff --git a/npm2deb/helper.py b/npm2deb/helper.py
+index af4aab1..20ffade 100644
+--- a/npm2deb/helper.py
++++ b/npm2deb/helper.py
+@@ -101,7 +101,7 @@ def search_for_reverse_dependencies(module):
+     return result
+ 
+ def search_for_dependencies(module, recursive=False,
+-        force=False, prefix=u''):
++        force=False, prefix=u'', expanded_dependencies=[]):
+     try:
+         if not isinstance(module, Npm2Deb):
+             dependencies = parseJSON(getstatusoutput('npm view "%s" '
+@@ -126,12 +126,13 @@ def search_for_dependencies(module, recursive=False,
+         dep_prefix = u'└─' if last_dep else u'├─'
+         print_formatted_dependency(u"%s %s (%s)" % (dep_prefix, dep,
+             result[dep]['version']), result[dep]['debian'], prefix)
+-        if recursive:
++        if recursive and not dep in expanded_dependencies:
++            expanded_dependencies.append(dep)
+             if (result[dep]['debian'] and force) or \
+                     result[dep]['debian'] is None:
+                 new_prefix = "%s%s " % (prefix, u"  " if last_dep else u"│ ")
+                 result[dep]['dependencies'] = search_for_dependencies(dep, \
+-                    recursive, force, new_prefix)
++                    recursive, force, new_prefix, expanded_dependencies)
+         else:
+             result[dep]['dependencies'] = None
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..34429d4
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+git_fix-prevent-infinite-loop.patch

-- 
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