[Pkg-javascript-commits] [npm2deb] 01/01: fix when files returned as string
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Thu Nov 3 08:42:30 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository npm2deb.
commit 7fa10c42b0955e979f3dc6874e05b61c90ca8434
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Thu Nov 3 14:12:09 2016 +0530
fix when files returned as string
---
...007-install-files-section-of-package-json.patch | 88 ++++++----------------
1 file changed, 25 insertions(+), 63 deletions(-)
diff --git a/debian/patches/0007-install-files-section-of-package-json.patch b/debian/patches/0007-install-files-section-of-package-json.patch
index 4e3d5b1..48ca53b 100644
--- a/debian/patches/0007-install-files-section-of-package-json.patch
+++ b/debian/patches/0007-install-files-section-of-package-json.patch
@@ -11,53 +11,11 @@ Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841995
npm2deb/__init__.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
-diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
-index 52fe76f..0e2bf16 100644
---- a/npm2deb/__init__.py
-+++ b/npm2deb/__init__.py
-@@ -158,6 +158,19 @@ def create_install(self):
- libs.append('bin')
- if _os.path.isdir('lib'):
- libs.append('lib')
-+
-+ # install files from directories field
-+ if 'directories' in self.json:
-+ directories = self.json['directories']
-+ if 'bin' in directories:
-+ libs.append(directories['bin'])
-+ if 'lib' in directories:
-+ libs.append(directories['lib'])
-+
-+ # install files from files field
-+ if 'files' in self.json:
-+ libs += self.json['files']
-+
- # install main if not in a subpath
- if 'main' in self.json:
- main = self.json['main']
-@@ -171,6 +184,7 @@ def create_install(self):
- libs.append('index.js')
- else:
- libs.append('*.js')
-+
- for filename in libs:
- content += "%s %s/\n" % (filename, self.debian_dest)
- utils.create_debian_file('install', content)
-
-From 342cb56f28419d28a30ae17cd0526cf2fdeec02b Mon Sep 17 00:00:00 2001
-From: Shanavas M <shanavas.m2 at gmail.com>
-Date: Mon, 31 Oct 2016 23:18:00 +0300
-Subject: [PATCH 2/2] Remove duplicate entries from debian/install file
-
----
- npm2deb/__init__.py | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
-index 0e2bf16..ed0b5d1 100644
---- a/npm2deb/__init__.py
-+++ b/npm2deb/__init__.py
-@@ -153,23 +153,23 @@ def create_links(self):
+Index: npm2deb/npm2deb/__init__.py
+===================================================================
+--- npm2deb.orig/npm2deb/__init__.py
++++ npm2deb/npm2deb/__init__.py
+@@ -209,11 +209,29 @@ You may want fix first these issues:\n""
def create_install(self):
content = ''
@@ -69,25 +27,28 @@ index 0e2bf16..ed0b5d1 100644
if _os.path.isdir('lib'):
- libs.append('lib')
+ libs.add('lib')
-
- # install files from directories field
- if 'directories' in self.json:
- directories = self.json['directories']
- if 'bin' in directories:
-- libs.append(directories['bin'])
++
++ # install files from directories field
++ if 'directories' in self.json:
++ directories = self.json['directories']
++ if 'bin' in directories:
+ libs.add(directories['bin'])
- if 'lib' in directories:
-- libs.append(directories['lib'])
++ if 'lib' in directories:
+ libs.add(directories['lib'])
-
- # install files from files field
- if 'files' in self.json:
-- libs += self.json['files']
-+ libs = libs.union(self.json['files'])
-
++
++ # install files from files field
++ if 'files' in self.json:
++ files = self.json['files']
++ # npm v1.4 returns string if files field has only one entry
++ if isinstance(files, str):
++ libs.add(files)
++ else:
++ libs = libs.union(files)
++
# install main if not in a subpath
if 'main' in self.json:
-@@ -178,12 +178,12 @@ def create_install(self):
+ main = self.json['main']
+@@ -221,12 +239,13 @@ You may want fix first these issues:\n""
if main == 'index':
main = 'index.js'
if not main.find('/') > 0:
@@ -100,6 +61,7 @@ index 0e2bf16..ed0b5d1 100644
else:
- libs.append('*.js')
+ libs.add('*.js')
-
++
for filename in libs:
content += "%s %s/\n" % (filename, self.debian_dest)
+ utils.create_debian_file('install', content)
--
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