[Pkg-javascript-commits] [npm2deb] 01/05: include patches by bignose, suhail
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Tue Feb 14 05:56:52 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 f1d885adeb57cab5ad5652b4d43d4ea0b21bd5a9
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Tue Feb 14 10:58:47 2017 +0530
include patches by bignose, suhail
---
...-upstream-description-from-Debian-package.patch | 112 +++++++++++++++++++++
...Add-suggestions-to-improve-the-ITP-report.patch | 34 +++++++
debian/patches/search-in-experimental.patch | 111 +++++++++++++++++++-
debian/patches/series | 2 +
4 files changed, 254 insertions(+), 5 deletions(-)
diff --git a/debian/patches/0001-Distinguish-upstream-description-from-Debian-package.patch b/debian/patches/0001-Distinguish-upstream-description-from-Debian-package.patch
new file mode 100644
index 0000000..b61feec
--- /dev/null
+++ b/debian/patches/0001-Distinguish-upstream-description-from-Debian-package.patch
@@ -0,0 +1,112 @@
+From 03cd5adac01c51077cff3edacad1fc9f4ee562c3 Mon Sep 17 00:00:00 2001
+From: Ben Finney <bignose at debian.org>
+Date: Fri, 10 Feb 2017 04:37:45 +1100
+Subject: [PATCH 1/2] Distinguish upstream description from Debian package
+ description.
+
+---
+ npm2deb/__init__.py | 13 +++++++------
+ npm2deb/templates.py | 27 ++++++++++++++++++---------
+ 2 files changed, 25 insertions(+), 15 deletions(-)
+
+diff --git a/npm2deb/__init__.py b/npm2deb/__init__.py
+index 0ac807bb..1aa9ad28 100644
+--- a/npm2deb/__init__.py
++++ b/npm2deb/__init__.py
+@@ -29,7 +29,7 @@ class Npm2Deb(object):
+ self.json = None
+ self.args = args
+ self.homepage = None
+- self.description = None
++ self.upstream_description = None
+ self.upstream_author = None
+ self.upstream_license = None
+ self.upstream_version = None
+@@ -295,8 +295,8 @@ and may not include tests.\n""")
+ % self.debian_name
+ args['Package'] = self.debian_name
+ args['Depends'] = self._get_Depends()
+- args['Description'] = self.description
+- args['Description_Long'] = 'FIX_ME long description'
++ args['Description'] = 'FIX_ME write the Debian package description'
++ args['upstream_description'] = self.upstream_description
+ template = utils.get_template('control')
+ utils.create_debian_file('control', template % args)
+
+@@ -451,7 +451,8 @@ and may not include tests.\n""")
+ args['debian_name'] = self.debian_name
+ args['upstream_author'] = self.upstream_author
+ args['homepage'] = self.homepage
+- args['description'] = self.description
++ args['description'] = 'FIX_ME write the Debian package description'
++ args['upstream_description'] = self.upstream_description
+ args['version'] = self.upstream_version
+ args['license'] = self.upstream_license
+ content = utils.get_template('wnpp')
+@@ -485,9 +486,9 @@ and may not include tests.\n""")
+
+ def _get_json_description(self):
+ if 'description' in self.json:
+- self.description = self.json['description']
++ self.upstream_description = self.json['description']
+ else:
+- self.description = 'FIX_ME description'
++ self.upstream_description = 'FIX_ME no upstream package description'
+
+ def _get_json_author(self):
+ if self.upstream_author:
+diff --git a/npm2deb/templates.py b/npm2deb/templates.py
+index 9bda4ee3..f88861e6 100644
+--- a/npm2deb/templates.py
++++ b/npm2deb/templates.py
+@@ -6,6 +6,20 @@ CHANGELOG = """%(debian_name)s (%(version)s-1) UNRELEASED; urgency=low
+
+ """
+
++description_template = """
++ Write the short and long descriptions for the Debian package as
++ explained in the Developer's Reference, §6.2.1 – §6.2.3.
++ .
++ You can start with the short upstream package description,
++ “%(upstream_description)s”.
++ .
++ Be aware that most upstream package descriptions are not written to
++ conform with Debian package guidelines. You need to explain the role
++ of this package for a Debian audience.
++ .
++ Node.js is an event-based server-side JavaScript engine.
++"""
++
+ CONTROL = """Source: %(Source)s
+ Section: web
+ Priority: optional
+@@ -26,10 +40,7 @@ Depends:
+ ${misc:Depends}
+ , %(Depends)s
+ Description: %(Description)s
+- %(Description_Long)s
+- .
+- Node.js is an event-based server-side JavaScript engine.
+-"""
++""" + description_template
+
+ RULES = """#!/usr/bin/make -f
+ # -*- makefile -*-
+@@ -80,11 +91,9 @@ X-Debbugs-CC: debian-devel at lists.debian.org
+ Programming Lang: JavaScript
+ Description : %(description)s
+
+- FIX_ME bug long description
+- .
+- Node.js is an event-based server-side JavaScript engine.
+-
+-"""
++ FIX_ME: This ITP report is not ready for submission, until you are
++ confident this package description is ready for Debian.
++ .""" + description_template
+
+ LICENSES = {}
+
+--
+2.11.0
+
diff --git a/debian/patches/0002-Add-suggestions-to-improve-the-ITP-report.patch b/debian/patches/0002-Add-suggestions-to-improve-the-ITP-report.patch
new file mode 100644
index 0000000..4d300fc
--- /dev/null
+++ b/debian/patches/0002-Add-suggestions-to-improve-the-ITP-report.patch
@@ -0,0 +1,34 @@
+From 020478164b46cac3b69836be897967c138de18f9 Mon Sep 17 00:00:00 2001
+From: Ben Finney <bignose at debian.org>
+Date: Fri, 10 Feb 2017 04:38:29 +1100
+Subject: [PATCH 2/2] Add suggestions to improve the ITP report.
+
+---
+ npm2deb/templates.py | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/npm2deb/templates.py b/npm2deb/templates.py
+index f88861e6..475f7451 100644
+--- a/npm2deb/templates.py
++++ b/npm2deb/templates.py
+@@ -93,7 +93,16 @@ X-Debbugs-CC: debian-devel at lists.debian.org
+
+ FIX_ME: This ITP report is not ready for submission, until you are
+ confident this package description is ready for Debian.
+- .""" + description_template
++ .""" + description_template + """
++FIX_ME: Explain why this package is suitable for adding to Debian. Is
++it a dependency of some other package? What benefit does it provide
++compared to other similar packages already in Debian?
++
++FIX_ME: Explain how you intend to consistently maintain this package
++in Debian. If you are not yet a Debian member, does this package need
++a sponsor? Do you have co-maintainers? Are you a member of the Debian
++JavaScript maintainers team?
++"""
+
+ LICENSES = {}
+
+--
+2.11.0
+
diff --git a/debian/patches/search-in-experimental.patch b/debian/patches/search-in-experimental.patch
index 79d3e60..0a749c1 100644
--- a/debian/patches/search-in-experimental.patch
+++ b/debian/patches/search-in-experimental.patch
@@ -1,13 +1,114 @@
--- a/npm2deb/helper.py
+++ b/npm2deb/helper.py
-@@ -26,6 +26,10 @@
+@@ -8,6 +8,7 @@
+ from npm2deb import Npm2Deb as _Npm2Deb
+ from npm2deb.utils import debug as _debug
+ from npm2deb.mapper import Mapper as _Mapper
++from npm2deb.utils import get_package_in_new as _get_package_in_new
+
+
+ DO_PRINT = False
+@@ -26,6 +27,7 @@
found = False
result = {}
my_print("Looking for existing repositories:")
-+ content = _getstatusoutput(["rmadison -u debian node-"+module])
-+ if content[1]:
-+ print(content[1]),
-+ found = True
++
for repo in repositories:
_debug(1, "search for %s in %s" % (module, repo))
url_base = "http://anonscm.debian.org/gitweb"
+@@ -85,21 +87,13 @@
+ _debug(1, "calling new-check")
+ found = False
+ formatted = " {0:20} {1:>3}"
+- url = "https://api.ftp-master.debian.org/sources_in_suite/new"
+- _debug(1, "opening url %s" % url)
+- data = _urlopen(url).read().decode('utf-8')
+- data = _parseJSON(data)
+- result = []
+- for package in data:
+- name = package['source']
+- version = package['version']
+- if not module in name:
+- continue
++ result = _get_package_in_new(module)
++ if result:
+ found = True
+- result.append(package)
+- my_print(formatted.format(package['source'],
+- package['version']
+- ))
++ my_print(formatted.format(result[0]['source'],
++ result[0]['version']
++ ))
++
+ if not found:
+ my_print(" None")
+ return result
+@@ -199,3 +193,5 @@
+ def print_formatted_dependency(npm, debian, prefix=u''):
+ formatted = u"{0:50}{1}"
+ my_print(formatted.format(u"%s%s" % (prefix, npm), debian))
++
++
+--- a/npm2deb/mapper.py
++++ b/npm2deb/mapper.py
+@@ -5,7 +5,7 @@
+
+ from npm2deb.utils import debug as _debug
+ from npm2deb.utils import debianize_name as _debianize_name
+-
++from npm2deb.utils import get_package_in_new as _get_package_in_new
+
+ DB_URL = 'https://wiki.debian.org/Javascript/Nodejs/Database'
+
+@@ -61,8 +61,15 @@
+ 'rmadison -s sid "%s" | grep source' % result['name'])
+
+ if madison[0] != 0:
+- result['name'] = None
+- return result
++ # checking if package is listed in NEW
++ in_new = _get_package_in_new(node_module)
++ if not in_new:
++ # Looking for package in debian experimental
++ madison = _getstatusoutput(["rmadison -u debian "\
++ + result['name']])
++ if madison[0] != 0:
++ result['name'] = None
++ return result
+
+ tmp = madison[1].split('|')
+ if len(tmp) >= 2:
+--- a/npm2deb/utils.py
++++ b/npm2deb/utils.py
+@@ -1,4 +1,6 @@
+ from subprocess import getstatusoutput as _getstatusoutput
++from urllib.request import urlopen as _urlopen
++from json import loads as _parseJSON
+ import codecs as _codecs
+ import os as _os
+
+@@ -110,3 +112,23 @@
+
+ def debianize_name(name):
+ return name.replace('_', '-').lower()
++
++def get_npmjs_homepage(name):
++ return 'https://npmjs.com/package/' + name
++
++def get_package_in_new(module):
++ """
++ Check if package is available in NEW
++ """
++ content = []
++ url = "https://api.ftp-master.debian.org/sources_in_suite/new"
++ debug(1, "opening url %s" % url)
++ data = _urlopen(url).read().decode('utf-8')
++ data = _parseJSON(data)
++ for package in data:
++ name = package['source']
++ version = package['version']
++ if not module in name:
++ continue
++ content.append(package)
++ return content
diff --git a/debian/patches/series b/debian/patches/series
index 3aec554..950fdbe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
search-in-experimental.patch
+0001-Distinguish-upstream-description-from-Debian-package.patch
+0002-Add-suggestions-to-improve-the-ITP-report.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