[Pkg-javascript-commits] [npm2deb] 01/02: fix for editorconfig
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Fri Apr 28 12:04:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository npm2deb.
commit 8be32d16b3857d86b4b377fbce0edcd880cf0abd
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Fri Apr 28 17:26:36 2017 +0530
fix for editorconfig
---
debian/patches/0004-fix-for-editorconfig.patch | 35 ++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 36 insertions(+)
diff --git a/debian/patches/0004-fix-for-editorconfig.patch b/debian/patches/0004-fix-for-editorconfig.patch
new file mode 100644
index 0000000..856b0b1
--- /dev/null
+++ b/debian/patches/0004-fix-for-editorconfig.patch
@@ -0,0 +1,35 @@
+From 653009d72acf16cdd2203824199b91bfd8baee47 Mon Sep 17 00:00:00 2001
+From: Shanavas M <shanavas.m2 at gmail.com>
+Date: Fri, 28 Apr 2017 14:20:41 +0300
+Subject: [PATCH] Get tarball root directory from member filename
+
+Some packages like 'editorconfig' has tarball root directory name
+other than 'package'
+
+Fixes #61
+---
+ npm2deb/__init__.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/npm2deb/__init__.py
++++ b/npm2deb/__init__.py
+@@ -434,11 +434,18 @@
+
+ tarball_file = info[1].strip('\n')
+ tarball = tarfile.open(tarball_file)
++ # get the root directory name
++ root_dir = tarball.getnames()[0]
++ # extract root directory name if memberfile contains '/'
++ index_of_slash = root_dir.find('/')
++ if index_of_slash != -1:
++ root_dir = root_dir[:index_of_slash]
++
+ tarball.extractall()
+ tarball.close()
+
+ # rename extracted directory
+- _os.rename('package', self.name)
++ _os.rename(root_dir, self.name)
+ # remove tarball file
+ _os.remove(tarball_file)
+
diff --git a/debian/patches/series b/debian/patches/series
index 2dc4711..0273f40 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ search-in-experimental.patch
0001-Distinguish-upstream-description-from-Debian-package.patch
0002-Add-suggestions-to-improve-the-ITP-report.patch
0003-hint-ITP.patch
+0004-fix-for-editorconfig.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