From e3f54b98d3a732af5fa5651144f570f83ec89a42 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 24 Sep 2018 09:53:03 +0200 Subject: [PATCH] Update to 3.30.1 - Remove patch for GNOME Evolution issue #86 (fixed upstream) - Disable tests subpackage - it uses python2 and it is unmaintained upstream - Remove BuildRequires on bogofilter and spamassassin --- .gitignore | 1 + evolution-3.30.0-evo-issue-86.patch | 340 ---------------------------- evolution.spec | 30 ++- sources | 2 +- 4 files changed, 22 insertions(+), 351 deletions(-) delete mode 100644 evolution-3.30.0-evo-issue-86.patch diff --git a/.gitignore b/.gitignore index b53a4ba..36929b1 100644 --- a/.gitignore +++ b/.gitignore @@ -152,3 +152,4 @@ evolution-2.31.5.tar.bz2 /evolution-3.29.91.tar.xz /evolution-3.29.92.tar.xz /evolution-3.30.0.tar.xz +/evolution-3.30.1.tar.xz diff --git a/evolution-3.30.0-evo-issue-86.patch b/evolution-3.30.0-evo-issue-86.patch deleted file mode 100644 index 261cb02..0000000 --- a/evolution-3.30.0-evo-issue-86.patch +++ /dev/null @@ -1,340 +0,0 @@ -diff --git a/src/e-util/test-html-editor-units-bugs.c b/src/e-util/test-html-editor-units-bugs.c -index ea3bf6f987..f89565f7e2 100644 ---- a/src/e-util/test-html-editor-units-bugs.c -+++ b/src/e-util/test-html-editor-units-bugs.c -@@ -1208,6 +1208,120 @@ test_bug_750636 (TestFixture *fixture) - g_test_fail (); - } - -+static void -+test_issue_86 (TestFixture *fixture) -+{ -+ const gchar *source_text = -+ "normal text\n" -+ "\n" -+ "> level 1\n" -+ "> level 1\n" -+ "> > level 2\n" -+ "> > level 2\n" -+ "> >\n" -+ "> > level 2\n" -+ ">\n" -+ "> level 1\n" -+ "> level 1\n" -+ ">\n" -+ "> > > level 3\n" -+ "> > > level 3\n" -+ ">\n" -+ "> > level 2\n" -+ "> > level 2\n" -+ ">\n" -+ "> level 1\n" -+ "\n" -+ "back normal text\n"; -+ gchar *converted, *to_insert; -+ -+ if (!test_utils_process_commands (fixture, -+ "mode:html\n")) { -+ g_test_fail (); -+ return; -+ } -+ -+ converted = camel_text_to_html (source_text, -+ CAMEL_MIME_FILTER_TOHTML_PRE | -+ CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | -+ CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES | -+ CAMEL_MIME_FILTER_TOHTML_QUOTE_CITATION, -+ 0xDDDDDD); -+ -+ g_return_if_fail (converted != NULL); -+ -+ to_insert = g_strconcat (converted, -+ "" -+ "", -+ NULL); -+ -+ test_utils_insert_content (fixture, to_insert, -+ E_CONTENT_EDITOR_INSERT_REPLACE_ALL | E_CONTENT_EDITOR_INSERT_TEXT_HTML); -+ -+ if (!test_utils_run_simple_test (fixture, -+ "", -+ HTML_PREFIX "
On Today, User wrote:
" -+ "
" -+ "
normal text
" -+ "

" -+ "
" -+ "
level 1
" -+ "
level 1
" -+ "
" -+ "
level 2
" -+ "
level 2
" -+ "

" -+ "
level 2
" -+ "
" -+ "

" -+ "
level 1
" -+ "
level 1
" -+ "

" -+ "
" -+ "
" -+ "
level 3
" -+ "
level 3
" -+ "
" -+ "
" -+ "

" -+ "
" -+ "
level 2
" -+ "
level 2
" -+ "
" -+ "

" -+ "
level 1
" -+ "
" -+ "

" -+ "
back normal text
" -+ "
" HTML_SUFFIX, -+ "On Today, User wrote:\n" -+ "> normal text\n" -+ "> \n" -+ "> > level 1\n" -+ "> > level 1\n" -+ "> > > level 2\n" -+ "> > > level 2\n" -+ "> > > \n" -+ "> > > level 2\n" -+ "> > \n" -+ "> > level 1\n" -+ "> > level 1\n" -+ "> > \n" -+ "> > > > level 3\n" -+ "> > > > level 3\n" -+ "> > \n" -+ "> > > level 2\n" -+ "> > > level 2\n" -+ "> > \n" -+ "> > level 1\n" -+ "> \n" -+ "> back normal text")) -+ g_test_fail (); -+ -+ g_free (to_insert); -+ g_free (converted); -+} -+ - void - test_add_html_editor_bug_tests (void) - { -@@ -1237,4 +1351,5 @@ test_add_html_editor_bug_tests (void) - test_utils_add_test ("/bug/780088", test_bug_780088); - test_utils_add_test ("/bug/788829", test_bug_788829); - test_utils_add_test ("/bug/750636", test_bug_750636); -+ test_utils_add_test ("/issue/86", test_issue_86); - } -diff --git a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c -index bdef1ccf57..71d80ae5a7 100644 ---- a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c -+++ b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c -@@ -6230,7 +6230,6 @@ e_editor_dom_convert_content (EEditorPage *editor_page, - WEBKIT_DOM_NODE (content_wrapper), - WEBKIT_DOM_NODE (e_editor_dom_prepare_paragraph (editor_page, FALSE)), - NULL); -- - if (!cite_body) { - if (!empty) { - WebKitDOMNode *child; -@@ -8804,6 +8803,133 @@ e_editor_dom_adapt_to_editor_dom_changes (EEditorPage *editor_page) - g_clear_object (&collection); - } - -+static void -+traverse_nodes_to_split_pre (WebKitDOMDocument *document, -+ WebKitDOMNode *node, -+ WebKitDOMNode *new_parent, /* can be NULL, then prepend to out_new_nodes */ -+ gboolean is_in_pre, -+ GSList **out_new_nodes) /* WebKitDOMNode * */ -+{ -+ if (is_in_pre && WEBKIT_DOM_IS_TEXT (node)) { -+ gchar *text; -+ -+ text = webkit_dom_text_get_whole_text (WEBKIT_DOM_TEXT (node)); -+ if (text) { -+ WebKitDOMElement *pre; -+ gint ii; -+ gchar **strv; -+ -+ strv = g_strsplit (text, "\n", -1); -+ -+ for (ii = 0; strv && strv[ii]; ii++) { -+ if (*(strv[ii])) { -+ gint len = strlen (strv[ii]); -+ -+ if (strv[ii][len - 1] == '\r') { -+ strv[ii][len - 1] = '\0'; -+ } -+ } -+ -+ /*
 is shown as a block, thus adding a new line at the end behaves like two 
-s */ -+ if (!*(strv[ii]) && !strv[ii + 1]) -+ break; -+ -+ pre = webkit_dom_document_create_element (document, "pre", NULL); -+ -+ if (*(strv[ii])) { -+ webkit_dom_html_element_set_inner_text (WEBKIT_DOM_HTML_ELEMENT (pre), strv[ii], NULL); -+ } else { -+ WebKitDOMElement *br; -+ -+ br = webkit_dom_document_create_element (document, "br", NULL); -+ webkit_dom_node_append_child (WEBKIT_DOM_NODE (pre), WEBKIT_DOM_NODE (br), NULL); -+ } -+ -+ if (new_parent) -+ webkit_dom_node_append_child (new_parent, WEBKIT_DOM_NODE (pre), NULL); -+ else -+ *out_new_nodes = g_slist_prepend (*out_new_nodes, pre); -+ } -+ -+ g_strfreev (strv); -+ } -+ -+ g_free (text); -+ } else if (WEBKIT_DOM_IS_HTML_PRE_ELEMENT (node)) { -+ is_in_pre = TRUE; -+ } else { -+ WebKitDOMNode *nd; -+ GError *error = NULL; -+ -+ nd = webkit_dom_node_clone_node_with_error (node, FALSE, &error); -+ if (nd) { -+ if (new_parent) -+ webkit_dom_node_append_child (new_parent, nd, NULL); -+ else -+ *out_new_nodes = g_slist_prepend (*out_new_nodes, nd); -+ -+ new_parent = nd; -+ } else { -+ g_warning ("%s: Failed to clone node %s: %s\n", G_STRFUNC, G_OBJECT_TYPE_NAME (node), error ? error->message : "Unknown error"); -+ } -+ } -+ -+ for (node = webkit_dom_node_get_first_child (node); -+ node; -+ node = webkit_dom_node_get_next_sibling (node)) { -+ traverse_nodes_to_split_pre (document, node, new_parent, is_in_pre, out_new_nodes); -+ } -+} -+ -+static void -+maybe_split_pre_paragraphs (WebKitDOMDocument *document) -+{ -+ WebKitDOMHTMLElement *body; -+ WebKitDOMNodeList *list; -+ -+ body = webkit_dom_document_get_body (document); -+ if (!body) -+ return; -+ -+ list = webkit_dom_document_query_selector_all (document, "pre", NULL); -+ if (webkit_dom_node_list_get_length (list)) { -+ WebKitDOMNode *body_node, *node, *current; -+ GSList *new_nodes = NULL, *to_remove = NULL, *link; -+ -+ g_clear_object (&list); -+ -+ body_node = WEBKIT_DOM_NODE (body); -+ webkit_dom_node_normalize (body_node); -+ -+ for (current = webkit_dom_node_get_first_child (body_node); -+ current; -+ current = webkit_dom_node_get_next_sibling (current)) { -+ traverse_nodes_to_split_pre (document, current, NULL, FALSE, &new_nodes); -+ to_remove = g_slist_prepend (to_remove, current); -+ } -+ -+ for (link = to_remove; link; link = g_slist_next (link)) { -+ node = link->data; -+ -+ webkit_dom_node_remove_child (body_node, node, NULL); -+ } -+ -+ /* They are in reverse order, thus reverse it */ -+ new_nodes = g_slist_reverse (new_nodes); -+ -+ for (link = new_nodes; link; link = g_slist_next (link)) { -+ node = link->data; -+ -+ webkit_dom_node_append_child (body_node, node, NULL); -+ } -+ -+ g_slist_free (to_remove); -+ g_slist_free (new_nodes); -+ } -+ -+ g_clear_object (&list); -+} -+ - void - e_editor_dom_process_content_after_load (EEditorPage *editor_page) - { -@@ -8853,60 +8979,8 @@ e_editor_dom_process_content_after_load (EEditorPage *editor_page) - } - - goto out; -- } else { -- WebKitDOMNodeList *list; -- gulong ii; -- -- list = webkit_dom_document_query_selector_all (document, "pre", NULL); -- for (ii = webkit_dom_node_list_get_length (list); ii--;) { -- WebKitDOMNode *node = webkit_dom_node_list_item (list, ii), *parent; -- WebKitDOMElement *element; -- gchar *inner_html; -- -- element = WEBKIT_DOM_ELEMENT (node); -- parent = webkit_dom_node_get_parent_node (node); -- inner_html = webkit_dom_element_get_inner_html (element); -- -- if (inner_html && *inner_html) { -- gchar **strv; -- -- strv = g_strsplit (inner_html, "\n", -1); -- if (strv && strv[0] && strv[1]) { -- WebKitDOMElement *pre; -- gint jj; -- -- for (jj = 0; strv[jj]; jj++) { -- pre = webkit_dom_document_create_element (document, "pre", NULL); -- if (*(strv[jj])) { -- gint len = strlen (strv[jj]); -- -- if (strv[jj][len - 1] == '\r') { -- strv[jj][len - 1] = '\0'; -- } -- } -- -- if (*(strv[jj])) { -- webkit_dom_html_element_set_inner_html (WEBKIT_DOM_HTML_ELEMENT (pre), strv[jj], NULL); -- } else { -- WebKitDOMElement *br; -- -- br = webkit_dom_document_create_element (document, "br", NULL); -- webkit_dom_node_append_child (WEBKIT_DOM_NODE (pre), WEBKIT_DOM_NODE (br), NULL); -- } -- -- webkit_dom_node_insert_before (parent, WEBKIT_DOM_NODE (pre), node, NULL); -- } -- -- remove_node (node); -- } -- -- g_strfreev (strv); -- } -- -- g_free (inner_html); -- } -- -- g_clear_object (&list); -+ } else if (!webkit_dom_element_has_attribute (WEBKIT_DOM_ELEMENT (body), "data-evo-draft")) { -+ maybe_split_pre_paragraphs (document); - } - - e_editor_dom_adapt_to_editor_dom_changes (editor_page); diff --git a/evolution.spec b/evolution.spec index 8f03e99..b07f333 100644 --- a/evolution.spec +++ b/evolution.spec @@ -1,5 +1,6 @@ %global _changelog_trimtime %(date +%s -d "1 year ago") %global _python_bytecompile_extra 0 +%global enable_installed_tests 0 %define glib2_version 2.46.0 %define gtk3_version 3.10.0 @@ -28,7 +29,7 @@ ### Abstract ### Name: evolution -Version: 3.30.0 +Version: 3.30.1 Release: 1%{?dist} Group: Applications/Productivity Summary: Mail and calendar client for GNOME @@ -38,8 +39,6 @@ Source: http://download.gnome.org/sources/%{name}/3.30/%{name}-%{version}.tar.xz ### Patches ### -Patch01: evolution-3.30.0-evo-issue-86.patch - Obsoletes: anjal <= %{last_anjal_version} Obsoletes: libgal2 <= %{last_libgal2_version} Obsoletes: evolution-NetworkManager < %{last_evo_nm_version} @@ -173,7 +172,6 @@ Group: Applications/Productivity Summary: Bogofilter plugin for Evolution Requires: %{name}%{?_isa} = %{version}-%{release} Requires: bogofilter -BuildRequires: bogofilter %description bogofilter This package contains the plugin to filter junk mail using Bogofilter. @@ -183,7 +181,6 @@ Group: Applications/Productivity Summary: SpamAssassin plugin for Evolution Requires: %{name}%{?_isa} = %{version}-%{release} Requires: spamassassin -BuildRequires: spamassassin %description spamassassin This package contains the plugin to filter junk mail using SpamAssassin. @@ -199,6 +196,7 @@ This package contains the plugin to import Microsoft Personal Storage Table (PST) files used by Microsoft Outlook and Microsoft Exchange. %endif +%if %{enable_installed_tests} %package tests Summary: Tests for the %{name} package Group: Development/Libraries @@ -209,11 +207,10 @@ Requires: python2-dogtail %description tests The %{name}-tests package contains tests that can be used to verify the functionality of the installed %{name} package. +%endif %prep -%setup -q -n evolution-%{version} - -%patch01 -p1 -b .evo-issue-86 +%setup -q -n %{name}-%{version} # Remove the welcome email from Novell for inbox in src/mail/default/*/Inbox; do @@ -245,15 +242,20 @@ fi %define gtkdoc_flags -DENABLE_GTK_DOC=OFF -DWITH_HELP=OFF %endif +%if %{enable_installed_tests} +%define tests_flags -DENABLE_INSTALLED_TESTS=ON +%else +%define tests_flags -DENABLE_INSTALLED_TESTS=OFF +%endif + CFLAGS="$RPM_OPT_FLAGS -fPIC -DLDAP_DEPRECATED -Wno-sign-compare -Wno-deprecated-declarations"; export CFLAGS %cmake -G "Unix Makefiles" \ -DENABLE_MAINTAINER_MODE=OFF \ -DVERSION_SUBSTRING=" (%{version}-%{release})" \ - %ldap_flags %ssl_flags %gtkdoc_flags \ + %ldap_flags %ssl_flags %gtkdoc_flags %tests_flags \ -DENABLE_PLUGINS=all \ -DENABLE_YTNEF=OFF \ - -DENABLE_INSTALLED_TESTS=ON \ .. make %{?_smp_mflags} @@ -501,11 +503,19 @@ grep -v "/usr/share/locale" evolution.lang > help.lang %{evo_plugin_dir}/liborg-gnome-pst-import.so %endif +%if %{enable_installed_tests} %files tests %{_libexecdir}/%{name}/installed-tests %{_datadir}/installed-tests +%endif %changelog +* Mon Sep 24 2018 Milan Crha - 3.30.1-1 +- Update to 3.30.1 +- Remove patch for GNOME Evolution issue #86 (fixed upstream) +- Disable tests subpackage - it uses python2 and it is unmaintained upstream +- Remove BuildRequires on bogofilter and spamassassin + * Mon Sep 03 2018 Milan Crha - 3.30.0-1 - Update to 3.30.0 - Add patch for GNOME Evolution issue #86 (Quoting of plain text mail into HTML mode mangles deeper levels) diff --git a/sources b/sources index 6ef8d59..70950d1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (evolution-3.30.0.tar.xz) = 15a28dc4cd3b4a194deadd7bb205e9942f193f8f5894e2cdd83e71404535cd9c43223e38d59eaa5dc9cdc977c057ee4f155df397e56079daa8432a6414010a01 +SHA512 (evolution-3.30.1.tar.xz) = 4df32a3419592c53954794dbffbbf1e8d84e02dfd2ad23c2e6c7c8477447e5f826839ebce9325cf9ce9b484725b57f6985123ec57f3c7af438a37194b297c4de