diff -Nru rawdog-2.21/debian/changelog rawdog-2.22/debian/changelog --- rawdog-2.21/debian/changelog 2015-07-18 23:46:55.000000000 +0000 +++ rawdog-2.22/debian/changelog 2016-10-11 19:05:51.000000000 +0000 @@ -1,3 +1,12 @@ +rawdog (2.22-1) unstable; urgency=medium + + * New upstream release (Closes: #839294) + * Check that the package meets Debian policy version 3.9.8 (no further + changes needed), and update Standards-Version. + * Use HTTPS version of Vcs-* URLs. + + -- Adam Sampson Tue, 11 Oct 2016 19:05:51 +0000 + rawdog (2.21-1) unstable; urgency=medium * New upstream release diff -Nru rawdog-2.21/debian/control rawdog-2.22/debian/control --- rawdog-2.21/debian/control 2015-07-18 23:42:31.000000000 +0000 +++ rawdog-2.22/debian/control 2016-10-11 19:05:47.000000000 +0000 @@ -5,9 +5,9 @@ Build-Depends: debhelper (>= 9), dh-python, python (>= 2.6.6-3~), python-feedparser (>= 5.1.2), python-tidylib X-Python-Version: >= 2.6 -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/collab-maint/rawdog.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/rawdog.git +Standards-Version: 3.9.8 +Vcs-Git: https://alioth.debian.org/anonscm/git/collab-maint/rawdog.git +Vcs-Browser: https://anonscm.debian.org/gitweb/?p=collab-maint/rawdog.git Homepage: http://offog.org/code/rawdog/ Package: rawdog diff -Nru rawdog-2.21/NEWS rawdog-2.22/NEWS --- rawdog-2.21/NEWS 2015-07-12 13:41:04.000000000 +0000 +++ rawdog-2.22/NEWS 2016-10-03 21:07:43.000000000 +0000 @@ -1,3 +1,17 @@ +- rawdog 2.22 + +When handling an HTTP 301 redirect response, check whether the new +location is an absolute URI (as the HTTP/1.1 specification says it +should be). Some broken servers return a relative path, or junk, and in +those cases rawdog shouldn't update the URL in the config file. + +Fix some more style problems reported by pylint. + +Specify the input and output character encodings for pytidylib +explicitly. tidylib 5 has changed the defaults from ASCII to UTF-8; +rawdog relies on it being ASCII in order to generate ASCII output +(reported by Lucas Nussbaum). + - rawdog 2.21 Don't crash when asked to show a non-existant template ("-s foo") -- and diff -Nru rawdog-2.21/PKG-INFO rawdog-2.22/PKG-INFO --- rawdog-2.21/PKG-INFO 2015-07-18 23:11:03.000000000 +0000 +++ rawdog-2.22/PKG-INFO 2016-10-11 18:39:42.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: rawdog -Version: 2.21 +Version: 2.22 Summary: RSS Aggregator Without Delusions Of Grandeur Home-page: http://offog.org/code/rawdog/ Author: Adam Sampson diff -Nru rawdog-2.21/rawdog rawdog-2.22/rawdog --- rawdog-2.21/rawdog 2011-05-15 12:05:48.000000000 +0000 +++ rawdog-2.22/rawdog 2016-07-26 11:33:47.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # rawdog: RSS aggregator without delusions of grandeur. -# Copyright 2003, 2004, 2005, 2006 Adam Sampson +# Copyright 2003, 2004, 2005, 2006, 2016 Adam Sampson # # rawdog is free software; you can redistribute and/or modify it # under the terms of that license as published by the Free Software @@ -18,7 +18,9 @@ # MA 02110-1301, USA, or see http://www.gnu.org/. from rawdoglib.rawdog import main -import sys, os + +import os +import sys def launch(): sys.exit(main(sys.argv[1:])) @@ -29,4 +31,3 @@ profile.run("launch()") else: launch() - diff -Nru rawdog-2.21/rawdoglib/plugins.py rawdog-2.22/rawdoglib/plugins.py --- rawdog-2.21/rawdoglib/plugins.py 2015-01-31 16:42:35.000000000 +0000 +++ rawdog-2.22/rawdoglib/plugins.py 2016-07-26 11:28:21.000000000 +0000 @@ -1,5 +1,5 @@ # plugins: handle add-on modules for rawdog. -# Copyright 2004, 2005, 2013 Adam Sampson +# Copyright 2004, 2005, 2013, 2016 Adam Sampson # # rawdog is free software; you can redistribute and/or modify it # under the terms of that license as published by the Free Software @@ -75,4 +75,3 @@ if not func(*args): return True return False - diff -Nru rawdog-2.21/rawdoglib/rawdog.py rawdog-2.22/rawdoglib/rawdog.py --- rawdog-2.21/rawdoglib/rawdog.py 2015-07-18 23:08:07.000000000 +0000 +++ rawdog-2.22/rawdoglib/rawdog.py 2016-10-11 18:38:18.000000000 +0000 @@ -1,5 +1,5 @@ # rawdog: RSS aggregator without delusions of grandeur. -# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014, 2015 Adam Sampson +# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013, 2014, 2015, 2016 Adam Sampson # # rawdog is free software; you can redistribute and/or modify it # under the terms of that license as published by the Free Software @@ -16,7 +16,7 @@ # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA, or see http://www.gnu.org/. -VERSION = "2.21" +VERSION = "2.22" HTTP_AGENT = "rawdog/" + VERSION STATE_VERSION = 2 @@ -41,6 +41,7 @@ import time import types import urllib2 +import urlparse try: import tidylib @@ -135,6 +136,8 @@ if config["tidyhtml"]: args = { "numeric_entities": 1, + "input_encoding": "ascii", + "output_encoding": "ascii", "output_html": 1, "output_xhtml": 0, "output_xml": 0, @@ -538,7 +541,22 @@ i += 1 location = responses[i - 1].get("location") - if location is None: + # According to RFC 2616, the Location header should be + # an absolute URI. This doesn't stop the occasional + # server sending something like "Location: /" or + # "Location: //foo/bar". It's usually a sign of + # brokenness, so fail rather than trying to interpret + # it liberally. + valid_uri = True + if location is not None: + parsed = urlparse.urlparse(location) + if parsed.scheme == "" or parsed.netloc == "": + valid_uri = False + + if not valid_uri: + errors.append("New URL: " + location) + errors.append("The feed returned a permanent redirect, but with an invalid new location.") + elif location is None: errors.append("The feed returned a permanent redirect, but without a new location.") else: errors.append("New URL: " + location) @@ -1990,4 +2008,3 @@ rawdog_p.close() return 0 - diff -Nru rawdog-2.21/setup.py rawdog-2.22/setup.py --- rawdog-2.21/setup.py 2015-07-18 23:07:59.000000000 +0000 +++ rawdog-2.22/setup.py 2016-10-11 18:38:08.000000000 +0000 @@ -7,16 +7,16 @@ print("rawdog requires Python 2.6 or later, and not Python 3.") sys.exit(1) -setup(name = "rawdog", - version = "2.21", - description = "RSS Aggregator Without Delusions Of Grandeur", - author = "Adam Sampson", - author_email = "ats@offog.org", - url = "http://offog.org/code/rawdog/", - scripts = ['rawdog'], - data_files = [('share/man/man1', ['rawdog.1'])], - packages = ['rawdoglib'], - classifiers = [ +setup(name="rawdog", + version="2.22", + description="RSS Aggregator Without Delusions Of Grandeur", + author="Adam Sampson", + author_email="ats@offog.org", + url="http://offog.org/code/rawdog/", + scripts=['rawdog'], + data_files=[('share/man/man1', ['rawdog.1'])], + packages=['rawdoglib'], + classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", diff -Nru rawdog-2.21/test-rawdog rawdog-2.22/test-rawdog --- rawdog-2.21/test-rawdog 2015-07-12 16:36:05.000000000 +0000 +++ rawdog-2.22/test-rawdog 2016-07-26 11:17:56.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # test-rawdog: run some basic tests to make sure rawdog's working. -# Copyright 2013, 2014, 2015 Adam Sampson +# Copyright 2013, 2014, 2015, 2016 Adam Sampson # # rawdog is free software; you can redistribute and/or modify it # under the terms of that license as published by the Free Software @@ -1303,7 +1303,7 @@ # dates that Python can work with in time_t format varies between platforms. # rawdog won't be able to display dates that Python can't handle, but it # should at least not crash if feedparser decides to present them -# (for example, if feedparser misparses a timezone as a feed). +# (for example, if feedparser misparses a timezone as a year). echo "__date__" >$statedir/item add "itemtemplate item" add "sortbyfeeddate true" @@ -1570,6 +1570,14 @@ add "feed 0 $httpurl/301" rune "without a new location" -u +for badurl in "/" "http:" "://example.org" "://example.org:80,example.org/"; do + begin "HTTP 301 to invalid Location $badurl" + add "changeconfig true" + add "feed 0 $httpurl/301/=$badurl" + rune "invalid new location" -u + contains $statedir/config "$httpurl/301/=$badurl" +done + begin "HTTP 410 gone" add "feed 0 $httpurl/410" rune "You should remove it" -u diff -Nru rawdog-2.21/testserver.py rawdog-2.22/testserver.py --- rawdog-2.21/testserver.py 2013-08-04 13:32:38.000000000 +0000 +++ rawdog-2.22/testserver.py 2016-07-26 10:08:22.000000000 +0000 @@ -1,5 +1,5 @@ # testserver: servers for rawdog's test suite. -# Copyright 2013 Adam Sampson +# Copyright 2013, 2016 Adam Sampson # # rawdog is free software; you can redistribute and/or modify it # under the terms of that license as published by the Free Software @@ -104,9 +104,16 @@ if m: # Request for a particular response code. code = int(m.group(1)) + dest = m.group(2) self.send_response(code) - if m.group(2): - self.send_header("Location", self.server.base_url + m.group(2)) + if dest: + if dest.startswith("/="): + # Provide an exact value for Location (to simulate an + # invalid response). + dest = dest[2:] + else: + dest = self.server.base_url + dest + self.send_header("Location", dest) self.end_headers() return None