Apply small cleanup patch from Debian. Bump PKGREVISION.

This commit is contained in:
schmonz 2007-01-19 00:55:06 +00:00
parent cec9d16c0c
commit 9647cc5421
3 changed files with 37 additions and 3 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.4 2007/01/18 22:31:17 schmonz Exp $
# $NetBSD: Makefile,v 1.5 2007/01/19 00:55:06 schmonz Exp $
#
DISTNAME= html2text-2.25
PKGREVISION= 1
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= textproc python
MASTER_SITES= ${HOMEPAGE}
@ -13,6 +14,7 @@ COMMENT= Convert HTML into easy-to-read plain ASCII text
WRKSRC= ${WRKDIR}
USE_TOOLS+= tr
NO_BUILD= yes
PYTHON_VERSIONS_ACCEPTED?= 24 23 22 21
@ -20,7 +22,8 @@ INSTALLATION_DIRS= share/html2text
do-extract:
${_PKG_SILENT}${_PKG_DEBUG} \
${CP} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ${WRKSRC}
${TR} -d '\r' < ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
> ${WRKSRC}/${DISTNAME}${EXTRACT_SUFX}
do-install:
cd ${WRKSRC}; \

View file

@ -1,5 +1,6 @@
$NetBSD: distinfo,v 1.3 2007/01/18 22:31:17 schmonz Exp $
$NetBSD: distinfo,v 1.4 2007/01/19 00:55:06 schmonz Exp $
SHA1 (html2text-2.25.py) = 84c0c38c068c29caba9e5d415c041dace3fd1615
RMD160 (html2text-2.25.py) = 4d09acb5fe209669933e1b29c81f32bddaf57311
Size (html2text-2.25.py) = 10020 bytes
SHA1 (patch-aa) = 14e55c182e018337480ff310d4724bd16d5a29c8

View file

@ -0,0 +1,30 @@
$NetBSD: patch-aa,v 1.1 2007/01/19 00:55:06 schmonz Exp $
--- html2text-2.25.py.orig 2007-01-18 19:06:49.000000000 -0500
+++ html2text-2.25.py
@@ -150,7 +150,7 @@ class _html2text(sgmllib.SGMLParser):
self.lastWasNL = 0
def outtextf(self, s):
- if type(s) is type(''): s = codecs.utf_8_decode(s)[0]
+ if type(s) is type(''): s = codecs.utf_8_decode(s, "replace")[0]
self.outtext += s
def close(self):
@@ -259,6 +259,7 @@ class _html2text(sgmllib.SGMLParser):
if attrs.has_key('src'):
attrs['href'] = attrs['src']
alt = attrs.get('alt', '')
+ alt = re.sub('\n', ' ', alt)
i = self.previousIndex(attrs)
if i is not None:
attrs = self.a[i]
@@ -279,7 +280,7 @@ class _html2text(sgmllib.SGMLParser):
if tag in ["ol", "ul"]:
if start:
self.list.append({'name':tag, 'num':0})
- else:
+ elif self.list:
if self.list: self.list.pop()
self.p()