[Pkg-javascript-commits] [npm2deb] 03/05: drop patches

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Nov 11 08:44:31 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 91b0ec54b956479ff1724ab0da0b76981b795f15
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Fri Nov 11 14:09:10 2016 +0530

    drop patches
---
 debian/patches/0001-use-rmadison.patch             |  23 ---
 debian/patches/0002-convert-to-lowercase.patch     |  91 -----------
 debian/patches/0003-fix-crash.patch                |  26 ---
 debian/patches/0004-bump-standards.patch           |  23 ---
 debian/patches/0005-fix-dependency-format.patch    |  24 ---
 debian/patches/0006-more-automation.patch          | 176 ---------------------
 ...007-install-files-section-of-package-json.patch |  67 --------
 debian/patches/series                              |   7 -
 8 files changed, 437 deletions(-)

diff --git a/debian/patches/0001-use-rmadison.patch b/debian/patches/0001-use-rmadison.patch
deleted file mode 100644
index 9320020..0000000
--- a/debian/patches/0001-use-rmadison.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From a672a0e34abee1e613ae82f03fd7b605ff495d8e Mon Sep 17 00:00:00 2001
-From: Shanavas M <shanavas.m2 at gmail.com>
-Date: Thu, 27 Oct 2016 19:06:04 +0300
-Subject: [PATCH] Use rmadison to find available packages
-
-Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836182
----
- npm2deb/mapper.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/npm2deb/mapper.py b/npm2deb/mapper.py
-index 5a7e26f..ed70b77 100644
---- a/npm2deb/mapper.py
-+++ b/npm2deb/mapper.py
-@@ -56,7 +56,7 @@ def get_debian_package(self, node_module):
-             return result
- 
-         madison = _getstatusoutput(
--            'apt-cache madison "%s" | grep Sources' % result['name'])
-+            'rmadison -s sid "%s" | grep source' % result['name'])
- 
-         if madison[0] != 0:
-             result['name'] = None
diff --git a/debian/patches/0002-convert-to-lowercase.patch b/debian/patches/0002-convert-to-lowercase.patch
deleted file mode 100644
index dd19e7c..0000000
--- a/debian/patches/0002-convert-to-lowercase.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From cd716fc9d22b450fee2b2374a31f96aa50d95978 Mon Sep 17 00:00:00 2001
-From: Shanavas M <shanavas.m2 at gmail.com>
-Date: Fri, 28 Oct 2016 15:03:07 +0300
-Subject: [PATCH 1/2] Convert package name to lowercase
-
-Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840226
----
- npm2deb/__init__.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
-index 1eabf0b..4907506 100644
---- a/npm2deb/__init__.py
-+++ b/npm2deb/__init__.py
-@@ -471,7 +471,7 @@ def _get_Depends(self):
-         return '\n , '.join(depends)
- 
-     def _debianize_name(self, name):
--        return name.replace('_', '-')
-+        return name.replace('_', '-').lower()
- 
-     def _get_github_url_from_git(self, url):
-         result = _getstatusoutput(
-
-From fe8d547405081c36a25a59e201be0127f7d815cb Mon Sep 17 00:00:00 2001
-From: Shanavas M <shanavas.m2 at gmail.com>
-Date: Fri, 28 Oct 2016 15:10:40 +0300
-Subject: [PATCH 2/2] Search debianized package names
-
----
- npm2deb/__init__.py | 5 +----
- npm2deb/mapper.py   | 4 +++-
- npm2deb/utils.py    | 3 +++
- 3 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
-index 4907506..53b46ad 100644
---- a/npm2deb/__init__.py
-+++ b/npm2deb/__init__.py
-@@ -53,7 +53,7 @@ def __init__(self, module_name=None, args={}):
-                 self.noclean = args['noclean']
- 
-         self.read_package_info()
--        self.debian_name = 'node-%s' % self._debianize_name(self.name)
-+        self.debian_name = 'node-%s' % utils.debianize_name(self.name)
-         self.debian_author = 'FIX_ME debian author'
-         if 'DEBFULLNAME' in _os.environ and 'DEBEMAIL' in _os.environ:
-             self.debian_author = "%s <%s>" % \
-@@ -470,9 +470,6 @@ def _get_Depends(self):
- 
-         return '\n , '.join(depends)
- 
--    def _debianize_name(self, name):
--        return name.replace('_', '-').lower()
--
-     def _get_github_url_from_git(self, url):
-         result = _getstatusoutput(
-             "nodejs -e "
-diff --git a/npm2deb/mapper.py b/npm2deb/mapper.py
-index 5a7e26f..e7d5b13 100644
---- a/npm2deb/mapper.py
-+++ b/npm2deb/mapper.py
-@@ -4,6 +4,8 @@
- from subprocess import getstatusoutput as _getstatusoutput
- 
- from npm2deb.utils import debug as _debug
-+from npm2deb.utils import debianize_name as _debianize_name
-+
- 
- DB_URL = 'https://wiki.debian.org/Javascript/Nodejs/Database'
- 
-@@ -50,7 +52,7 @@ def get_debian_package(self, node_module):
-                 result['info'] = ('error', db_package['error'])
-                 self.append_warning('error', node_module, db_package['error'])
-         else:
--            result['name'] = 'node-%s' % node_module
-+            result['name'] = 'node-%s' % _debianize_name(node_module)
- 
-         if not result['name']:
-             return result
-diff --git a/npm2deb/utils.py b/npm2deb/utils.py
-index a2daf65..6937f13 100644
---- a/npm2deb/utils.py
-+++ b/npm2deb/utils.py
-@@ -107,3 +107,6 @@ def create_dir(dir):
-     except OSError as oserror:
-         raise OSError("Error: directory %s already exists." %
-                       oserror.filename)
-+
-+def debianize_name(name):
-+    return name.replace('_', '-').lower()
diff --git a/debian/patches/0003-fix-crash.patch b/debian/patches/0003-fix-crash.patch
deleted file mode 100644
index 960e6f4..0000000
--- a/debian/patches/0003-fix-crash.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Description: don't crash for invalid url
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840169
-
-diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
-index 1eabf0b..473d6a6 100644
---- a/npm2deb/__init__.py
-+++ b/npm2deb/__init__.py
-@@ -412,13 +412,17 @@ class Npm2Deb(object):
- 
-     def _get_json_repo_url(self):
-         result = 'FIX_ME repo url'
-+        url = None
-         if 'repository' in self.json:
-             repository = self.json['repository']
-             if isinstance(repository, str):
-                 url = repository
-             elif isinstance(repository, dict) and 'url' in repository:
-                 url = repository['url']
--            if url.startswith('git') or (isinstance(repository, dict) and
-+
-+            if not url:
-+                pass            # repository field is not in expected format
-+            elif url.startswith('git') or (isinstance(repository, dict) and
-                                          'type' in repository and
-                                          repository['type'] == 'git'):
-                 if url.find('github') >= 0:
diff --git a/debian/patches/0004-bump-standards.patch b/debian/patches/0004-bump-standards.patch
deleted file mode 100644
index 1e87bd8..0000000
--- a/debian/patches/0004-bump-standards.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 4ba137d4729649a5f8f081185513bc70a5c0d55c Mon Sep 17 00:00:00 2001
-From: Pirate Praveen Arimbrathodiyil <praveen at debian.org>
-Date: Sat, 29 Oct 2016 19:43:59 +0530
-Subject: [PATCH] bump standards version
-
-bump standards version of generated packages to 3.9.8
----
- npm2deb/__init__.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
-index 1eabf0b..5164e29 100644
---- a/npm2deb/__init__.py
-+++ b/npm2deb/__init__.py
-@@ -12,7 +12,7 @@
- 
- VERSION = '0.2.5'
- DEBHELPER = 9
--STANDARDS_VERSION = '3.9.7'
-+STANDARDS_VERSION = '3.9.8'
- 
- 
- class Npm2Deb(object):
diff --git a/debian/patches/0005-fix-dependency-format.patch b/debian/patches/0005-fix-dependency-format.patch
deleted file mode 100644
index 24edef7..0000000
--- a/debian/patches/0005-fix-dependency-format.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4dc756ef5849bf51ee41938f33ca4680d6a0829b Mon Sep 17 00:00:00 2001
-From: Suhail P <psuhailp at gmail.com>
-Date: Fri, 28 Oct 2016 12:20:20 +0000
-Subject: [PATCH 1/2] changing CONTROL file dependency package version format
-
----
- npm2deb/__init__.py | 1 +
- 1 file changed, 1 insertion(+)
-
-Index: npm2deb/npm2deb/__init__.py
-===================================================================
---- npm2deb.orig/npm2deb/__init__.py
-+++ npm2deb/npm2deb/__init__.py
-@@ -461,7 +461,10 @@ class Npm2Deb(object):
-                     mapper.append_warning('error', dep, 'dependency %s '
-                                           'not in debian' % (name))
-                 version = dependencies[dep].replace('~', '')
-+                version = dependencies[dep].replace('^', '')
-                 if version:
-+                    if version.find('.x') is not -1:
-+                        version = version.replace('.x', '.0')
-                     if version[0].isdigit():
-                         version = '>= %s' % version
-                     elif version == '*' or version == 'latest':
diff --git a/debian/patches/0006-more-automation.patch b/debian/patches/0006-more-automation.patch
deleted file mode 100644
index d026d86..0000000
--- a/debian/patches/0006-more-automation.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-From f496bbfd8398b0ec0e3501780350a626a3271bbe Mon Sep 17 00:00:00 2001
-From: Suhail P <psuhailp at gmail.com>
-Date: Wed, 2 Nov 2016 08:58:04 +0000
-Subject: [PATCH 1/8] automating uscan and uupdate
-
----
- npm2deb/__init__.py | 19 ++++++++++++++-----
- npm2deb/scripts.py  | 38 +++++++++++++++++++++++++++++---------
- 2 files changed, 43 insertions(+), 14 deletions(-)
-
-Index: npm2deb/npm2deb/__init__.py
-===================================================================
---- npm2deb.orig/npm2deb/__init__.py
-+++ npm2deb/npm2deb/__init__.py
-@@ -4,6 +4,7 @@ from dateutil import tz as _tz
- from shutil import rmtree as _rmtree
- from urllib.request import urlopen as _urlopen
- from subprocess import getstatusoutput as _getstatusoutput
-+from subprocess import call as _call
- import os as _os
- import re as _re
- 
-@@ -36,6 +37,7 @@ class Npm2Deb(object):
-         self.debian_standards = STANDARDS_VERSION
-         self.debian_debhelper = DEBHELPER
-         self.noclean = False
-+        self.upstream_watch = False
-         if args:
-             if 'upstream_license' in args and args['upstream_license']:
-                 self.upstream_license = args['upstream_license']
-@@ -85,6 +87,90 @@ class Npm2Deb(object):
-         utils.change_dir('..')
-         self.create_itp_bug()
- 
-+    def initiate_build(self ,saved_path):
-+        """
-+        Try building deb package after creating required files using start().
-+        'uscan', 'uupdate' and 'dpkg-buildpackage' are run if debian/watch is OK.
-+        """
-+        uscan_info = self.test_uscan()
-+        if uscan_info[0] == 0:
-+            self.run_uscan()
-+
-+            for name in _os.listdir('..'):
-+                orig_file = _re.search('%s_(\d.*)\.orig\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))' % self.debian_name, name)
-+                if orig_file:
-+                    orig_file = orig_file.group(0)
-+                    break
-+            self.run_uupdate(orig_file)
-+
-+            new_dir = orig_file[:orig_file.find('.orig')].replace('_','-')
-+            utils.change_dir('../%s' % new_dir)
-+            self.run_buildpackage()
-+            self.edit_changelog()
-+
-+            debian_path = "%s/%s/debian" % (self.name, new_dir)
-+            print ('\nRemember, your new source directory is %s/%s' % (self.name, new_dir))
-+
-+        else:
-+            debian_path = "%s/%s/debian" % (self.name, self.debian_name)
-+
-+        print("""
-+This is not a crystal ball, so please take a look at auto-generated files.\n
-+You may want fix first these issues:\n""")
-+
-+        utils.change_dir(saved_path)
-+        _call('/bin/grep --color=auto FIX_ME -r %s/*' % debian_path, shell=True)
-+
-+        if uscan_info[0] != 0:
-+            print ("\nUse uscan to get orig source files. Fix debian/watch and then run\
-+                    \n$ uscan --download-current-version\n")
-+
-+        if self.upstream_watch:
-+            print ("""
-+*** Warning ***\nUsing fakeupstream to download npm dist tarballs, because upstream
-+git repo is missing tags. Its better to ask upstream to tag their releases
-+instead of using npm dist tarballs as dist tarballs may contain pre built files
-+and may not include tests.""")
-+
-+    def edit_changelog(self):
-+        """
-+        This function is to remove extra line '* New upstream release'
-+        from debian/changelog
-+        """
-+        with open('debian/changelog', 'r') as f:
-+            data = f.read()
-+        f.close()
-+
-+        data_list = data.split('\n')
-+        data_list.pop(3)
-+
-+        with open('debian/changelog', 'w') as f:
-+            f.write('\n'.join(data_list))
-+        f.close()
-+
-+    def run_buildpackage(self):
-+        print ("\nBuilding the binary package")
-+        _call('dpkg-source -b .', shell=True)
-+        _call('dpkg-buildpackage', shell=True)
-+        # removing auto generated temporary files
-+        _call('fakeroot debian/rules clean', shell=True)
-+
-+    def run_uupdate(self, tar_file):
-+        print ('\nCreating debian source package...')
-+        _call('uupdate -b ../%s' % tar_file, shell=True)
-+
-+    def run_uscan(self):
-+        print ('\nDownloading source tarball file using debian/watch file...')
-+        _os.system('uscan --download-current-version')
-+
-+    def test_uscan(self):
-+        info = _getstatusoutput('uscan --watchfile "debian/watch" '
-+                                    '--package "{}" '
-+                                    '--upstream-version 0 --no-download'
-+                                    .format(self.debian_name))
-+        return info
-+
-+
-     def create_itp_bug(self):
-         utils.debug(1, "creating wnpp bug template")
-         utils.create_file('%s_itp.mail' % self.debian_name, self.get_ITP())
-@@ -118,14 +204,13 @@ class Npm2Deb(object):
- 
-             utils.create_debian_file('watch', content)
-             # test watch with uscan, raise exception if status is not 0
--            info = _getstatusoutput('uscan --watchfile "debian/watch" '
--                                    '--package "{}" '
--                                    '--upstream-version 0 --no-download'
--                                    .format(self.debian_name))
--            if info[0] != 0:
-+            uscan_info = self.test_uscan()
-+
-+            if uscan_info[0] != 0:
-                 raise ValueError
- 
-         except ValueError:
-+            self.upstream_watch = True
-             content = utils.get_watch('fakeupstream') % args
-             utils.create_debian_file('watch', content)
- 
-@@ -330,6 +415,7 @@ class Npm2Deb(object):
-         self._get_json_version()
-         self._get_json_license()
- 
-+
-     def download(self):
-         utils.debug(1, "downloading %s via npm" % self.name)
-         info = _getstatusoutput('npm install "%s"' % self.name)
-Index: npm2deb/npm2deb/scripts.py
-===================================================================
---- npm2deb.orig/npm2deb/scripts.py
-+++ npm2deb/npm2deb/scripts.py
-@@ -274,20 +274,13 @@ def create(args):
-         _utils.create_dir(npm2deb.name)
-         _utils.change_dir(npm2deb.name)
-         npm2deb.start()
--        _utils.change_dir(saved_path)
-+        _utils.change_dir(npm2deb.debian_name)
-+        npm2deb.initiate_build(saved_path)
-+
-     except OSError as os_error:
-         print(str(os_error))
-         exit(1)
- 
--    debian_path = "%s/%s/debian" % (npm2deb.name, npm2deb.debian_name)
--
--    print("""
--This is not a crystal ball, so please take a look at auto-generated files.\n
--You may want fix first these issues:\n""")
--    _call('/bin/grep --color=auto FIX_ME -r %s/*' % debian_path, shell=True)
--    print ("\nUse uscan to get orig source files. Fix debian/watch and then run\
--            \n$ uscan --download-current-version\n")
--
-     _show_mapper_warnings()
- 
- 
diff --git a/debian/patches/0007-install-files-section-of-package-json.patch b/debian/patches/0007-install-files-section-of-package-json.patch
deleted file mode 100644
index ab77e95..0000000
--- a/debian/patches/0007-install-files-section-of-package-json.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 6e2827d31e34237c1b5edb9274fd1ebc97e227f6 Mon Sep 17 00:00:00 2001
-From: Shanavas M <shanavas.m2 at gmail.com>
-Date: Mon, 31 Oct 2016 22:52:11 +0300
-Subject: [PATCH 1/2] Install files from directories and files fields
-
-https://docs.npmjs.com/files/package.json#directories
-https://docs.npmjs.com/files/package.json#files
-
-Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841995
----
- npm2deb/__init__.py | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-Index: npm2deb/npm2deb/__init__.py
-===================================================================
---- npm2deb.orig/npm2deb/__init__.py
-+++ npm2deb/npm2deb/__init__.py
-@@ -238,11 +238,29 @@ and may not include tests.""")
- 
-     def create_install(self):
-         content = ''
--        libs = ['package.json']
-+        libs = {'package.json'}
-         if _os.path.isdir('bin'):
--            libs.append('bin')
-+            libs.add('bin')
-         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.add(directories['bin'])
-+            if 'lib' in directories:
-+                libs.add(directories['lib'])
-+
-+        # 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:
-             main = self.json['main']
-@@ -250,12 +268,13 @@ and may not include tests.""")
-             if main == 'index':
-                 main = 'index.js'
-             if not main.find('/') > 0:
--                libs.append(_os.path.normpath(main))
-+                libs.add(_os.path.normpath(main))
-         else:
-             if _os.path.exists('index.js'):
--                libs.append('index.js')
-+                libs.add('index.js')
-             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)
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index a0e213e..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,7 +0,0 @@
-0001-use-rmadison.patch
-0002-convert-to-lowercase.patch
-0003-fix-crash.patch
-0004-bump-standards.patch
-0005-fix-dependency-format.patch
-0006-more-automation.patch
-0007-install-files-section-of-package-json.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