From tobias.rehbein@web.de  Tue Oct  6 17:49:08 2009
Return-Path: <tobias.rehbein@web.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6B0C1065679
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  6 Oct 2009 17:49:08 +0000 (UTC)
	(envelope-from tobias.rehbein@web.de)
Received: from fmmailgate03.web.de (fmmailgate03.web.de [217.72.192.234])
	by mx1.freebsd.org (Postfix) with ESMTP id 6763E8FC25
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  6 Oct 2009 17:49:08 +0000 (UTC)
Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215])
	by fmmailgate03.web.de (Postfix) with ESMTP id 8C9D811F21DDB
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  6 Oct 2009 19:49:07 +0200 (CEST)
Received: from [95.88.224.31] (helo=sushi.pseudo.local)
	by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256)
	(WEB.DE 4.110 #314)
	id 1MvE9p-0000XV-00
	for FreeBSD-gnats-submit@freebsd.org; Tue, 06 Oct 2009 19:49:05 +0200
Received: from sushi.pseudo.local (localhost [127.0.0.1])
	by sushi.pseudo.local (8.14.3/8.14.3) with ESMTP id n96HnKhY002744
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 6 Oct 2009 19:49:20 +0200 (CEST)
	(envelope-from tobi@sushi.pseudo.local)
Received: (from tobi@localhost)
	by sushi.pseudo.local (8.14.3/8.14.3/Submit) id n96HnJ9n002743;
	Tue, 6 Oct 2009 19:49:19 +0200 (CEST)
	(envelope-from tobi)
Message-Id: <200910061749.n96HnJ9n002743@sushi.pseudo.local>
Date: Tue, 6 Oct 2009 19:49:19 +0200 (CEST)
From: Tobias Rehbein <tobias.rehbein@web.de>
Sender: tobias.rehbein@web.de
Reply-To: Tobias Rehbein <tobias.rehbein@web.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] port mail/rss2email fails for certain feeds
X-Send-Pr-Version: 3.113
X-GNATS-Notify: chifeng@gmail.com

>Number:         139383
>Category:       ports
>Synopsis:       [patch] port mail/rss2email fails for certain feeds
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 06 17:50:01 UTC 2009
>Closed-Date:    Wed Oct 07 02:12:24 UTC 2009
>Last-Modified:  Wed Oct 14 01:10:07 UTC 2009
>Originator:     Tobias Rehbein
>Release:        FreeBSD 8.0-RC1 i386
>Organization:
>Environment:
System: FreeBSD sushi.pseudo.local 8.0-RC1 FreeBSD 8.0-RC1 #54: Sat Oct 3 16:40:05 CEST 2009 tobi@sushi.pseudo.local:/usr/obj/usr/src/sys/SUSHI i386


	
>Description:
	rss2email fails to process certain feeds. Most notably for me it bails out for sourceforges file release feeds.

>How-To-Repeat:
	Example feed exposing the error:

	http://sourceforge.net/api/file/index/project-id/143991/rss
>Fix:
	Attached is a patch which works around the issue. I have pulled it out of:
	http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=543710

	The corresponding bug report for feedparser is:
	http://code.google.com/p/feedparser/issues/detail?id=96

--- mail-rss2email.diff begins here ---
diff -ruN mail/rss2email.orig/Makefile mail/rss2email/Makefile
--- mail/rss2email.orig/Makefile	2009-09-30 16:05:17.000000000 +0200
+++ mail/rss2email/Makefile	2009-10-06 10:48:54.000000000 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	rss2email
 PORTVERSION=	2.65
+PORTREVISION=	1
 CATEGORIES=	mail python
 MASTER_SITES=	http://www.chifeng.name/dist/rss2email/
 
diff -ruN mail/rss2email.orig/files/patch-rss2email.py mail/rss2email/files/patch-rss2email.py
--- mail/rss2email.orig/files/patch-rss2email.py	1970-01-01 01:00:00.000000000 +0100
+++ mail/rss2email/files/patch-rss2email.py	2009-10-06 10:47:13.000000000 +0200
@@ -0,0 +1,30 @@
+--- ./rss2email.py.orig	2009-10-06 10:43:03.000000000 +0200
++++ ./rss2email.py	2009-10-06 10:43:26.000000000 +0200
+@@ -348,15 +348,15 @@
+ 	if conts:
+ 		if HTMLOK:
+ 			for c in conts:
+-				if contains(c.type, 'html'): return ('HTML', c.value)
++				if contains(c.get('type',''), 'html'): return ('HTML', c.value)
+ 	
+ 		if not HTMLOK: # Only need to convert to text if HTML isn't OK
+ 			for c in conts:
+-				if contains(c.type, 'html'):
++				if contains(c.get('type',''), 'html'):
+ 					return html2text(c.value)
+ 		
+ 		for c in conts:
+-			if c.type == 'text/plain': return c.value
++			if c.get('type','') == 'text/plain': return c.value
+ 	
+ 		return conts[0].value	
+ 	
+@@ -595,7 +595,7 @@
+ 					
+ 					if 'title_detail' in entry and entry.title_detail:
+ 						title = entry.title_detail.value
+-						if contains(entry.title_detail.type, 'html'):
++						if contains(entry.title_detail.get('type',''), 'html'):
+ 							title = html2text(title)
+ 					else:
+ 						title = getContent(entry)[:70]
--- mail-rss2email.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Oct 6 17:50:11 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139383 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: chifeng@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/139383: [patch] port mail/rss2email fails for certain feeds
Date: Tue, 6 Oct 2009 17:50:09 UT

 Maintainer of mail/rss2email,
 
 Please note that PR ports/139383 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/139383
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Tobias Rehbein <tobias.rehbein@web.de>
To: bug-followup@FreeBSD.org
Cc: freebsd-ports-bugs@FreeBSD.org
Subject: Re: ports/139383: [patch] port mail/rss2email fails for certain feeds
Date: Tue, 6 Oct 2009 20:15:50 +0200

 --ew6BAiZeqk4r7MaW
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 The patch fails to apply. This is caused by dos-style line endings. I can't get
 diff to maintain the '^M'... But I guess you get the idea of the patch. Sorry
 
 Tobias
 
 --ew6BAiZeqk4r7MaW
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.13 (FreeBSD)
 
 iEYEARECAAYFAkrLiVYACgkQ6LYxOE8q4xRd3gCeMI9HI9NU7biBBYBzpBnSjiVM
 G8kAoNR+G5TvDYiagPNArN6arRGzv86w
 =QVSB
 -----END PGP SIGNATURE-----
 
 --ew6BAiZeqk4r7MaW--

From: chifeng <chifeng@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/139383: [patch] port mail/rss2email fails for certain feeds
Date: Wed, 7 Oct 2009 07:18:42 +0800

 I have already updated to last version, please close this ticket, thanks!
 
 regards.
 chifeng
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Oct 7 02:11:59 UTC 2009 
State-Changed-Why:  
apparently fixed with upgrade to latest version. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139383 

From: Tobias Rehbein <tobias.rehbein@web.de>
To: bug-followup@freebsd.org
Cc: chifeng@gmail.com, linimon@freebsd.org
Subject: Re: ports/139383: [patch] port mail/rss2email fails for certain feeds
Date: Wed, 7 Oct 2009 07:26:07 +0200

 --SUOF0GtieIMvvwua
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Have you tried the example feed. The problem persists with the unpatched latest
 version (2.65). I have attached another patch that applies cleanly and works
 fine for me.
 
 Please check this issue again.
 
 --SUOF0GtieIMvvwua
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="mail-rss2email.diff"
 
 diff -ruN mail/rss2email.orig/Makefile mail/rss2email/Makefile
 --- mail/rss2email.orig/Makefile	2009-10-06 19:50:12.000000000 +0200
 +++ mail/rss2email/Makefile	2009-10-07 07:19:39.000000000 +0200
 @@ -7,6 +7,7 @@
  
  PORTNAME=	rss2email
  PORTVERSION=	2.65
 +PORTREVISION=	1
  CATEGORIES=	mail python
  MASTER_SITES=	http://www.chifeng.name/dist/rss2email/
  
 @@ -27,6 +28,8 @@
  post-patch:
  	@${REINPLACE_CMD} -e 's|@PYTHONCMD@|${PYTHON_CMD}|;s|@DATADIR@|${DATADIR}|'\
  		${WRKSRC}/r2e
 +	@${REINPLACE_CMD} -e "s:c\.type:c.get('type',''):"\
 +		${WRKSRC}/rss2email.py
  
  do-install:
  	@${INSTALL} -d ${DATADIR}/
 
 --SUOF0GtieIMvvwua--

From: Tobias Rehbein <tobias.rehbein@web.de>
To: bug-followup@freebsd.org
Cc: chifeng <chifeng@gmail.com>
Subject: Re: ports/139383: [patch] port mail/rss2email fails for certain feeds
Date: Tue, 13 Oct 2009 20:30:08 +0200

 --3uo+9/B/ebqu+fSQ
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Am Wed, Oct 07, 2009 at 02:12:23AM +0000 schrieb linimon@freebsd.org:
 > State-Changed-From-To: feedback->closed
 > State-Changed-By: linimon
 > State-Changed-When: Wed Oct 7 02:11:59 UTC 2009
 > State-Changed-Why: 
 > apparently fixed with upgrade to latest version.
 
 As stated this is persistent bug even with the latest version in ports. Here is
 another patch fixing this issue. This is cleaner than the latest version.
 
 
 
 --3uo+9/B/ebqu+fSQ
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="mail-rss2email.diff"
 
 diff -ruN rss2email.orig/Makefile rss2email/Makefile
 --- rss2email.orig/Makefile	2009-09-30 16:05:17.000000000 +0200
 +++ rss2email/Makefile	2009-10-12 09:17:39.000000000 +0200
 @@ -7,6 +7,7 @@
  
  PORTNAME=	rss2email
  PORTVERSION=	2.65
 +PORTREVISION=	1
  CATEGORIES=	mail python
  MASTER_SITES=	http://www.chifeng.name/dist/rss2email/
  
 @@ -27,6 +28,8 @@
  post-patch:
  	@${REINPLACE_CMD} -e 's|@PYTHONCMD@|${PYTHON_CMD}|;s|@DATADIR@|${DATADIR}|'\
  		${WRKSRC}/r2e
 +	@${REINPLACE_CMD} -e "s|\([^[:alnum:]]\)c.type\([^[:alnum:]]\)|\1c.get('type','')\2|"\
 +		${WRKSRC}/rss2email.py
  
  do-install:
  	@${INSTALL} -d ${DATADIR}/
 
 --3uo+9/B/ebqu+fSQ--

From: chifeng <chifeng@gmail.com>
To: Tobias Rehbein <tobias.rehbein@web.de>
Cc: bug-followup@freebsd.org
Subject: Re: ports/139383: [patch] port mail/rss2email fails for certain feeds
Date: Wed, 14 Oct 2009 09:07:43 +0800

 --001636e90a2141d9400475daca29
 Content-Type: text/plain; charset=ISO-8859-1
 
 Hi Tobias,
 I have already test your patch, it's works fine!  I'm not sure, anybody can
 re-open this ticket.
 so, can you/I submit another PR for this bug fix? Thank you!
 
 Chifeng
 
 
 On Wed, Oct 14, 2009 at 2:30 AM, Tobias Rehbein <tobias.rehbein@web.de>wrote:
 
 > Am Wed, Oct 07, 2009 at 02:12:23AM +0000 schrieb linimon@freebsd.org:
 > > State-Changed-From-To: feedback->closed
 > > State-Changed-By: linimon
 > > State-Changed-When: Wed Oct 7 02:11:59 UTC 2009
 > > State-Changed-Why:
 > > apparently fixed with upgrade to latest version.
 >
 > As stated this is persistent bug even with the latest version in ports.
 > Here is
 > another patch fixing this issue. This is cleaner than the latest version.
 >
 >
 >
 
 
 -- 
 regards.
 chifeng
 
 --001636e90a2141d9400475daca29
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 Hi Tobias,<div><br></div><div>I have already test your patch, it&#39;s work=
 s fine! =A0I&#39;m not sure, anybody can re-open this ticket.</div><div>so,=
  can you/I submit another PR for this bug fix? Thank you!<br><br></div><div=
 >
 Chifeng</div><div><br></div><div><br><div class=3D"gmail_quote">On Wed, Oct=
  14, 2009 at 2:30 AM, Tobias Rehbein <span dir=3D"ltr">&lt;<a href=3D"mailt=
 o:tobias.rehbein@web.de">tobias.rehbein@web.de</a>&gt;</span> wrote:<br><bl=
 ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
 ccc solid;padding-left:1ex;">
 Am Wed, Oct 07, 2009 at 02:12:23AM +0000 schrieb <a href=3D"mailto:linimon@=
 freebsd.org">linimon@freebsd.org</a>:<br>
 <div class=3D"im">&gt; State-Changed-From-To: feedback-&gt;closed<br>
 &gt; State-Changed-By: linimon<br>
 &gt; State-Changed-When: Wed Oct 7 02:11:59 UTC 2009<br>
 &gt; State-Changed-Why:<br>
 &gt; apparently fixed with upgrade to latest version.<br>
 <br>
 </div>As stated this is persistent bug even with the latest version in port=
 s. Here is<br>
 another patch fixing this issue. This is cleaner than the latest version.<b=
 r>
 <br>
 <br>
 </blockquote></div><br><br clear=3D"all"><br>-- <br>regards.<br>chifeng<br>
 </div>
 
 --001636e90a2141d9400475daca29--
>Unformatted:
