From 93ec5b401a2dc13b6cde0289122426fd053a6773 Mon Sep 17 00:00:00 2001 From: Randy Barlow Date: Sep 21 2016 03:33:53 +0000 Subject: Add three patches to fix issues with the 2.2.0 release. Backport two patches to correct module paths from the devel branch upstream, and apply a patch that stops NULL comments from being rendered with markdown. --- diff --git a/0001-Only-put-the-comment-through-markdown-if-there-is-a-.patch b/0001-Only-put-the-comment-through-markdown-if-there-is-a-.patch new file mode 100644 index 0000000..74152a1 --- /dev/null +++ b/0001-Only-put-the-comment-through-markdown-if-there-is-a-.patch @@ -0,0 +1,30 @@ +From 08618689315c5be0eba7467ded5cc27226d1d9f2 Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Wed, 21 Sep 2016 00:43:30 +0000 +Subject: [PATCH] Only put the comment through markdown if there is a comment + +Because sometimes, the contents are None (null in the database), which +breaks the markdown processing. + +Signed-off-by: Patrick Uiterwijk +--- + bodhi/server/templates/fragments.html | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/bodhi/server/templates/fragments.html b/bodhi/server/templates/fragments.html +index 77c02b1..b38d647 100644 +--- a/bodhi/server/templates/fragments.html ++++ b/bodhi/server/templates/fragments.html +@@ -34,7 +34,9 @@ + +
+
++ % if comment.text: + ${util.markup(comment.text) | n} ++ % endif +
+
+ % if comment.karma: +-- +2.10.0 + diff --git a/0002-bodhi.util-bodhi.server.util.patch b/0002-bodhi.util-bodhi.server.util.patch new file mode 100644 index 0000000..1e2273f --- /dev/null +++ b/0002-bodhi.util-bodhi.server.util.patch @@ -0,0 +1,23 @@ +From 7de4fe7ea90f7171625fe2899fbb0257977abe64 Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Wed, 21 Sep 2016 01:35:15 +0000 +Subject: [PATCH] bodhi.util -> bodhi.server.util + +Signed-off-by: Patrick Uiterwijk +--- + bodhi/server/templates/override.html | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bodhi/server/templates/override.html b/bodhi/server/templates/override.html +index 3473cfa..847487c 100644 +--- a/bodhi/server/templates/override.html ++++ b/bodhi/server/templates/override.html +@@ -1,4 +1,4 @@ +-<%namespace name="util" module="bodhi.util"/> ++<%namespace name="util" module="bodhi.server.util"/> + <%inherit file="master.html"/> + +
+-- +2.10.0 + diff --git a/0003-More-.server-entries.patch b/0003-More-.server-entries.patch new file mode 100644 index 0000000..a2d20f8 --- /dev/null +++ b/0003-More-.server-entries.patch @@ -0,0 +1,30 @@ +From c48af9d3f7919f9f3ad7944b81899f76c9329f2c Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Wed, 21 Sep 2016 01:42:44 +0000 +Subject: [PATCH] More .server entries + +Signed-off-by: Patrick Uiterwijk +--- + bodhi/server/services/updates.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bodhi/server/services/updates.py b/bodhi/server/services/updates.py +index 7f7546c..ee6436e 100644 +--- a/bodhi/server/services/updates.py ++++ b/bodhi/server/services/updates.py +@@ -93,9 +93,9 @@ def get_update_for_editing(request): + """Return a single update from an id, title, or alias for the edit form""" + return dict( + update=request.validated['update'], +- types=reversed(bodhi.models.UpdateType.values()), +- severities=sorted(bodhi.models.UpdateSeverity.values(), key=bodhi.server.util.sort_severity), +- suggestions=reversed(bodhi.models.UpdateSuggestion.values()), ++ types=reversed(bodhi.server.models.UpdateType.values()), ++ severities=sorted(bodhi.server.models.UpdateSeverity.values(), key=bodhi.server.util.sort_severity), ++ suggestions=reversed(bodhi.server.models.UpdateSuggestion.values()), + ) + + +-- +2.10.0 + diff --git a/bodhi.spec b/bodhi.spec index c2bc7da..f1eef3d 100644 --- a/bodhi.spec +++ b/bodhi.spec @@ -3,12 +3,22 @@ Name: bodhi Version: 2.2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A modular framework that facilitates publishing software updates Group: Applications/Internet License: GPLv2+ URL: https://github.com/fedora-infra/bodhi Source0: https://github.com/fedora-infra/bodhi/archive/%{version}.tar.gz +# There is a problem where comments can be NULL in the database. This patch doesn't +# fix that problem, but it does fix template rendering on updates that have such comments. +# See https://github.com/fedora-infra/bodhi/issues/949 +Patch0: 0001-Only-put-the-comment-through-markdown-if-there-is-a-.patch +# This is backported from upstream, and fixes an import path. +# See https://github.com/fedora-infra/bodhi/pull/944 +Patch1: 0002-bodhi.util-bodhi.server.util.patch +# This is backported from upstream, and fixes an import path. +# See https://github.com/fedora-infra/bodhi/pull/945 +Patch2: 0003-More-.server-entries.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch ExcludeArch: ppc64 ppc @@ -199,6 +209,10 @@ updates for a software distribution. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + # Kill some dev deps sed -i '/pyramid_debugtoolbar/d' setup.py sed -i '/pyramid_debugtoolbar/d' development.ini.example @@ -312,6 +326,10 @@ PYTHONPATH=. %{__python} setup.py test %changelog +* Tue Sep 20 2016 Randy Barlow - 2.2.0-2 +- Backport two patches to correct module paths from the devel branch upstream. +- Apply a patch that stops NULL comments from being rendered with markdown. + * Thu Sep 08 2016 Randy Barlow - 2.2.0-1 - Update to 2.2.0. The spec file was largely taken from lmacken's COPR repository. - Add a common subpackage to own the Python distribution (#1372461).