summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-12-14 07:01:28 +0100
committerDaniel Baumann <daniel@debian.org>2024-12-14 07:01:28 +0100
commitd78a8c20d5fc739b6a6395f663dc50c3bd450b46 (patch)
tree3ce78b487f2192d099180af90b436867f24500b9
parentReleasing debian version 1.0.0-2. (diff)
downloadpython-feedgen-d78a8c20d5fc739b6a6395f663dc50c3bd450b46.tar.xz
python-feedgen-d78a8c20d5fc739b6a6395f663dc50c3bd450b46.zip
Adding patch from Lars Kellogg-Stedman <lars@oddbit.com> to fix links in atom feeds.
Signed-off-by: Daniel Baumann <daniel@debian.org>
-rw-r--r--debian/patches/debian/0001-fix-atom-feed-links.patch38
-rw-r--r--debian/patches/series1
2 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/debian/0001-fix-atom-feed-links.patch b/debian/patches/debian/0001-fix-atom-feed-links.patch
new file mode 100644
index 0000000..cac3d47
--- /dev/null
+++ b/debian/patches/debian/0001-fix-atom-feed-links.patch
@@ -0,0 +1,38 @@
+Author: Lars Kellogg-Stedman <lars@oddbit.com>
+Subject: Fix handling of links in atom feeds
+ The existing code iterated over entry links like this:
+ .
+ for link in self.__atom_link or []:
+ link = xml_elem('link', entry, href=link['href'])
+ .
+ The first line in the loop overwrites the `link` variable, rendering the
+ rest of the loop a no-op. This commit corrects the situation by creating a
+ new variable rather than overwriting the loop variable.
+
+diff -Naurp python-feedgen.orig/feedgen/entry.py python-feedgen/feedgen/entry.py
+--- python-feedgen.orig/feedgen/entry.py
++++ python-feedgen/feedgen/entry.py
+@@ -137,17 +137,17 @@ class FeedEntry(object):
+ _add_text_elm(entry, self.__atom_content, 'content')
+
+ for link in self.__atom_link or []:
+- link = xml_elem('link', entry, href=link['href'])
++ linkelm = xml_elem('link', entry, href=link['href'])
+ if link.get('rel'):
+- link.attrib['rel'] = link['rel']
++ linkelm.attrib['rel'] = link['rel']
+ if link.get('type'):
+- link.attrib['type'] = link['type']
++ linkelm.attrib['type'] = link['type']
+ if link.get('hreflang'):
+- link.attrib['hreflang'] = link['hreflang']
++ linkelm.attrib['hreflang'] = link['hreflang']
+ if link.get('title'):
+- link.attrib['title'] = link['title']
++ linkelm.attrib['title'] = link['title']
+ if link.get('length'):
+- link.attrib['length'] = link['length']
++ linkelm.attrib['length'] = link['length']
+
+ _add_text_elm(entry, self.__atom_summary, 'summary')
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..09abc62
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+debian/0001-fix-atom-feed-links.patch