Hello community, here is the log from the commit of package yelp for openSUSE:Factory checked in at Mon Feb 21 12:00:35 CET 2011. -------- --- GNOME/yelp/yelp.changes 2011-02-13 17:24:41.000000000 +0100 +++ yelp/yelp.changes 2011-02-20 17:42:04.000000000 +0100 @@ -1,0 +2,18 @@ +Sun Feb 20 15:39:19 CET 2011 - vuntz@opensuse.org + +- Port to xulrunner2 on 11.4 and later: + - Add yelp-xulrunner20.patch to port the build system and code. + - Do not apply yelp-no-xulrunner20.patch when we build against + xulrunner2. + - Call autoreconf when we build against xulrunner2. + - Use mozilla-xulrunner20-devel BuildRequires on 11.4 and later. +- Add yelp-no-freeze-on-window-move.patch to fix freezes when the + yelp window is moved: this is happening because we synchronously + save a file, with a fsync() call. And that hits us really hard + when a window is moved because we do that several times. +- Add yelp-fix-crash-on-print.patch: this fixes a crash when + printing a complete document. +- Add yelp-fix-html-print.patch: this fixes a crash and infinite + loop when printing a pure HTML document. + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- yelp-fix-crash-on-print.patch yelp-fix-html-print.patch yelp-no-freeze-on-window-move.patch yelp-xulrunner20.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yelp.spec ++++++ --- /var/tmp/diff_new_pack.7BUlE8/_old 2011-02-21 11:56:14.000000000 +0100 +++ /var/tmp/diff_new_pack.7BUlE8/_new 2011-02-21 11:56:14.000000000 +0100 @@ -19,16 +19,20 @@ # Starting with openSUSE 11.3 we use tracker instead of beagle %define no_beagle 0%{suse_version} >= 1130 -Name: yelp -%if %suse_version > 1120 +%if %suse_version >= 1140 +%define xulrunner_version 20 +%endif +%if %suse_version == 1130 %define xulrunner_version 192 -%else -%if %suse_version > 1110 +%endif +%if %suse_version == 1120 %define xulrunner_version 191 -%else -%define xulrunner_version 190 %endif +%if 0%{?xulrunner_version} == 0 +%define xulrunner_version NOTSUPPORTED %endif + +Name: yelp BuildRequires: dbus-1-glib-devel BuildRequires: fdupes BuildRequires: gcc-c++ @@ -50,7 +54,7 @@ License: GPLv2+ ; LGPLv2.1+ Group: System/GUI/GNOME Version: 2.30.2 -Release: 4 +Release: 11 Summary: Help Browser for the GNOME Desktop Source: ftp://ftp.gnome.org/pub/GNOME/sources/yelp/2.12/%{name}-%{version}.tar.bz2 Url: http://www.gnome.org @@ -59,12 +63,20 @@ Patch0: yelp-fix-URI-handler.patch # PATCH-FIX-OPENSUSE yelp-no-xulrunner20.patch vuntz@opensuse.org -- Do not try to use xulrunner 2.0, as it's not working. Patch1: yelp-no-xulrunner20.patch +# PATCH-FIX-OPENSUSE yelp-xulrunner20.patch vuntz@opensuse.org -- Port to xulrunner 2.0. Note that upstream moved to webkit, so there's no point in sending the patch upstream. +Patch2: yelp-xulrunner20.patch # PATCH-FEATURE-OPENSUSE yelp-2.13.5-use-susehelp.patch -- make gnome-help a symlink to susehelp for better cross-desktop compatibility Patch6: yelp-2.13.5-use-susehelp.patch # PATCH-FEATURE-OPENSUSE yelp-handle-help-uri.patch vuntz@novell.com -- handle help: URI Patch9: yelp-handle-help-uri.patch # PATCH-FIX-UPSTREAM yelp-missing-slash.patch dimstar@opensuse.org - Use g_build_filename to avoid missing slash problem, taken from git. Patch10: yelp-missing-slash.patch +# PATCH-FIX-UPSTREAM yelp-fix-crash-on-print.patch bgo#642808 vuntz@opensuse.org -- Fix crash when printing a whole document: we were freeing memory we shouldn't. +Patch11: yelp-fix-crash-on-print.patch +# PATCH-FIX-UPSTREAM yelp-fix-html-print.patch bgo#642811 vuntz@opensuse.org -- Fix crash when printing a pure HTML document +Patch12: yelp-fix-html-print.patch +# PATCH-FIX-UPSTREAM yelp-no-freeze-on-window-move.patch bgo#642813 vuntz@opensuse.org -- Fix freeze when yelp window is moved. Similar to ce9025fffd63568305313cd7fddbd17fd8e058f5 upstream for the new yelp +Patch13: yelp-no-freeze-on-window-move.patch Provides: suse_help_viewer # We need the stylesheets from gnome-doc-utils Requires: gnome-doc-utils @@ -83,12 +95,22 @@ %setup -q translation-update-upstream %patch0 -p1 +%if %xulrunner_version != 20 %patch1 -p1 +%else +%patch2 -p1 +%endif %patch6 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 %build +%if %xulrunner_version == 20 +autoreconf -fi +%endif %configure make %{?jobs:-j%jobs} ++++++ yelp-fix-crash-on-print.patch ++++++ commit b1b83204de2eef17e746c82138325b997d1684fd Author: Vincent Untz <vuntz@gnome.org> Date: Sun Feb 20 14:48:40 2011 +0100 Fix crash when printing a whole document We use g_strfreev() on an array with const strings. That's bad :-) https://bugzilla.gnome.org/show_bug.cgi?id=642808 diff --git a/src/yelp-db-print.c b/src/yelp-db-print.c index b85eea6..6a48f84 100644 --- a/src/yelp-db-print.c +++ b/src/yelp-db-print.c @@ -477,17 +477,17 @@ dbprint_process (YelpDbprint *dbprint) params_max += 20; params = g_renew (gchar *, params, params_max); } - params[params_i++] = "db.chunk.extension"; + params[params_i++] = g_strdup ("db.chunk.extension"); params[params_i++] = g_strdup (""""); - params[params_i++] = "db.chunk.info_basename"; + params[params_i++] = g_strdup ("db.chunk.info_basename"); params[params_i++] = g_strdup (""index""); - params[params_i++] = "db.chunk.max_depth"; + params[params_i++] = g_strdup ("db.chunk.max_depth"); params[params_i++] = g_strdup ("0"); - params[params_i++] = "db2html.navbar.top"; + params[params_i++] = g_strdup ("db2html.navbar.top"); params[params_i++] = g_strdup ("0"); - params[params_i++] = "db2html.navbar.bottom"; + params[params_i++] = g_strdup ("db2html.navbar.bottom"); params[params_i++] = g_strdup ("0"); - params[params_i++] = "db2html.sidenav"; + params[params_i++] = g_strdup ("db2html.sidenav"); params[params_i++] = g_strdup ("0"); params[params_i] = NULL; ++++++ yelp-fix-html-print.patch ++++++ commit ea6d2b724ae5b868e08b8ba3593ff79666912b81 Author: Vincent Untz <vuntz@gnome.org> Date: Sun Feb 20 15:55:13 2011 +0100 Fix crash and infinite loop when printing HTML document https://bugzilla.gnome.org/show_bug.cgi?id=642811 diff --git a/src/yelp-window.c b/src/yelp-window.c index 1221ba3..abad787 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -1181,6 +1181,8 @@ yelp_window_load (YelpWindow *window, const gchar *uri) (void *) window); g_free (faux_frag_id); priv->current_document = doc; + } else { + window->priv->current_document = NULL; } Exit: @@ -2190,6 +2192,8 @@ window_print_page_cb (GtkAction *action, YelpWindow *window) * There are more sinister forces at work... */ + yelp_html_set_base_uri (html, priv->uri); + switch (priv->current_type) { case YELP_RRN_TYPE_HTML: yelp_html_open_stream (html, "text/html"); @@ -2204,8 +2208,8 @@ window_print_page_cb (GtkAction *action, YelpWindow *window) g_assert_not_reached (); } - while ((g_input_stream_read_all - ((GInputStream *)stream, buffer, BUFFER_SIZE, &n, NULL, NULL))) { + while ((n = g_input_stream_read + ((GInputStream *)stream, buffer, BUFFER_SIZE, NULL, NULL))) { yelp_html_write (html, buffer, n); } ++++++ yelp-no-freeze-on-window-move.patch ++++++ commit fd70739a133053042360d14fd7e6bc9db884e021 Author: Vincent Untz <vuntz@gnome.org> Date: Sun Feb 20 16:00:00 2011 +0100 Fix small freezes when moving window This is similar to ce9025ff: we only save the window size after a timeout, to stop always saving a file which calls fsync() and is therefore slow. We also don't save the size if it hasn't changed. https://bugzilla.gnome.org/show_bug.cgi?id=642813 diff --git a/src/yelp-window.c b/src/yelp-window.c index abad787..ea57576 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -284,6 +284,10 @@ struct _YelpWindowPriv { gulong cancel_handler; gulong finish_handler; + guint resize_timeout; + gint saved_width; + gint saved_height; + gint toc_pause; GtkActionGroup *action_group; @@ -510,8 +514,12 @@ window_init (YelpWindow *window) width = YELP_CONFIG_WIDTH_DEFAULT; if (height == 0) height = YELP_CONFIG_HEIGHT_DEFAULT; + } + window->priv->saved_width = width; + window->priv->saved_height = height; + g_free (config_path); g_key_file_free (keyfile); @@ -538,6 +546,10 @@ window_finalize (GObject *object) YelpWindow *window = YELP_WINDOW (object); YelpWindowPriv *priv = window->priv; + if (window->priv->resize_timeout) + g_source_remove (window->priv->resize_timeout); + window->priv->resize_timeout = 0; + g_object_unref (priv->action_group); g_object_unref (priv->ui_manager); @@ -1810,26 +1822,22 @@ window_set_loading (YelpWindow *window) /** Window Callbacks **********************************************************/ static gboolean -window_configure_cb (GtkWidget *widget, - GdkEventConfigure *event, - gpointer data) +save_window_size (YelpWindow *window, + gpointer data) { - gint width, height; GKeyFile *keyfile; GError *config_error = NULL; gchar *sdata, *config_path; gsize config_size; - gtk_window_get_size (GTK_WINDOW (widget), &width, &height); - keyfile = g_key_file_new(); config_path = g_strconcat (g_get_home_dir(), YELP_CONFIG_PATH, NULL); g_key_file_set_integer (keyfile, YELP_CONFIG_GEOMETRY_GROUP, - YELP_CONFIG_WIDTH, width); + YELP_CONFIG_WIDTH, window->priv->saved_width); g_key_file_set_integer (keyfile, YELP_CONFIG_GEOMETRY_GROUP, - YELP_CONFIG_HEIGHT, height); + YELP_CONFIG_HEIGHT, window->priv->saved_height); sdata = g_key_file_to_data (keyfile, &config_size, NULL); @@ -1846,6 +1854,31 @@ window_configure_cb (GtkWidget *widget, return FALSE; } +static gboolean +window_configure_cb (GtkWidget *widget, + GdkEventConfigure *event, + gpointer data) +{ + gint width, height; + YelpWindow *window = YELP_WINDOW (widget); + + gtk_window_get_size (GTK_WINDOW (widget), &width, &height); + + if (width == window->priv->saved_width && + height == window->priv->saved_height) + return FALSE; + + window->priv->saved_width = width; + window->priv->saved_height = height; + + if (window->priv->resize_timeout) + g_source_remove (window->priv->resize_timeout); + + window->priv->resize_timeout = g_timeout_add (200, (GSourceFunc) save_window_size, widget); + + return FALSE; +} + /** Gecko Callbacks ***********************************************************/ static void ++++++ yelp-xulrunner20.patch ++++++ Index: yelp-2.30.2/m4/gecko.m4 =================================================================== --- yelp-2.30.2.orig/m4/gecko.m4 +++ yelp-2.30.2/m4/gecko.m4 @@ -212,25 +212,6 @@ AC_LANG_PUSH([C++]) _SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS $_GECKO_CFLAGS" -AC_MSG_CHECKING([[whether we have a gtk 2 gecko build]]) -AC_RUN_IFELSE( - [AC_LANG_SOURCE( - [[#include <mozilla-config.h> - #include <string.h> - #include <stdlib.h> - int main(void) { - if (strcmp (MOZ_DEFAULT_TOOLKIT, "gtk2") == 0 || - strcmp (MOZ_DEFAULT_TOOLKIT, "cairo-gtk2") == 0) - return EXIT_SUCCESS; - - return EXIT_FAILURE; - } ]] - )], - [result=yes], - [AC_MSG_ERROR([[This program needs a gtk 2 gecko build]])], - [result=maybe]) -AC_MSG_RESULT([$result]) - AC_MSG_CHECKING([[whether we have a gecko debug build]]) AC_COMPILE_IFELSE( [AC_LANG_SOURCE( @@ -304,7 +285,9 @@ if (!stream) return 126; #ifdef MOZILLA_1_8_BRANCH version = "1.8.1"; #else -if (strncmp (MOZILLA_VERSION, "1.9", strlen ("1.9")) == 0) { +if (strncmp (MOZILLA_VERSION, "2.0", strlen ("2.0")) == 0) { + version = "2.0"; +} else if (strncmp (MOZILLA_VERSION, "1.9", strlen ("1.9")) == 0) { version = "1.9"; } else if (strncmp (MOZILLA_VERSION, "1.8", strlen ("1.8")) == 0) { version = "1.8"; @@ -328,7 +311,7 @@ AC_LANG_POP([C++]) gecko_cv_gecko_version_int="$(echo "$gecko_cv_gecko_version" | $AWK -F . '{print [$]1 * 1000000 + [$]2 * 1000 + [$]3}')" -if test "$gecko_cv_gecko_version_int" -lt "1007000" -o "$gecko_cv_gecko_version_int" -gt "1009000"; then +if test "$gecko_cv_gecko_version_int" -lt "1007000" -o "$gecko_cv_gecko_version_int" -gt "2000000"; then AC_MSG_ERROR([Gecko version $gecko_cv_gecko_version is not supported!]) fi @@ -350,7 +333,10 @@ if test "$gecko_cv_gecko_version_int" -g fi if test "${gecko_cv_gecko}" = "libxul-embedding" -o "${gecko_cv_gecko}" = "libxul"; then - PKG_CHECK_EXISTS([${gecko_cv_gecko} >= 1.9.1],[gecko_cv_have_gecko_1_9_1=yes gecko_cv_gecko_version="1.9.1" gecko_cv_gecko_version_int=1009001],[gecko_cv_have_gecko_1_9_1=no]) + PKG_CHECK_EXISTS([${gecko_cv_gecko} >= 1.9.1], + [ gecko_cv_have_gecko_1_9_1=yes + if test "$gecko_cv_gecko_version_int" -lt "2000000"; then gecko_cv_gecko_version="1.9.1" gecko_cv_gecko_version_int=1009001; fi + ],[gecko_cv_have_gecko_1_9_1=no]) else gecko_cv_have_gecko_1_9_1=no fi @@ -359,6 +345,11 @@ if test "$gecko_cv_have_gecko_1_9_1" = " AC_DEFINE([HAVE_GECKO_1_9_1],[1],[Define if we have gecko 1.9.1]) fi +if test "$gecko_cv_gecko_version_int" -ge "2000000"; then + AC_DEFINE([HAVE_GECKO_2_0],[1],[Define if we have gecko 2.0]) + gecko_cv_have_gecko_2_0=yes +fi + fi # if gecko_cv_have_gecko $1[]_VERSION=$gecko_cv_gecko_version @@ -407,6 +398,7 @@ AM_CONDITIONAL([HAVE_GECKO_1_8],[test "$ AM_CONDITIONAL([HAVE_GECKO_1_8_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1008001"]) AM_CONDITIONAL([HAVE_GECKO_1_9],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1009000"]) AM_CONDITIONAL([HAVE_GECKO_1_9_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_1_9_1" = "yes"]) +AM_CONDITIONAL([HAVE_GECKO_2_0],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_2_0" = "yes"]) AM_CONDITIONAL([HAVE_GECKO_HOME],[test "x$_GECKO_HOME" != "x"]) AM_CONDITIONAL([HAVE_GECKO_DEBUG],[test "$gecko_cv_have_debug" = "yes"]) AM_CONDITIONAL([HAVE_GECKO_XPCOM_GLUE],[test "$gecko_cv_have_xpcom_glue" = "yes"]) Index: yelp-2.30.2/src/yelp-gecko-services.cpp =================================================================== --- yelp-2.30.2.orig/src/yelp-gecko-services.cpp +++ yelp-2.30.2/src/yelp-gecko-services.cpp @@ -32,7 +32,11 @@ #include <nsIComponentManager.h> #include <nsComponentManagerUtils.h> #include <nsIComponentRegistrar.h> +#ifndef HAVE_GECKO_2_0 #include <nsIGenericFactory.h> +#else +#include <nsIFactory.h> +#endif #include <nsILocalFile.h> #include <nsIPrintSettings.h> #include <nsServiceManagerUtils.h> @@ -418,6 +422,8 @@ PrintListener::SetPrintSettings (YelpPri /* component registration */ +#ifndef HAVE_GECKO_2_0 + NS_GENERIC_FACTORY_CONSTRUCTOR(GPrintingPromptService) static const nsModuleComponentInfo sAppComps[] = { @@ -462,3 +468,115 @@ yelp_register_printing () } } + +#else + +/* + * Adapted from code from ./embedding/browser/activex/src/control/PromptService.cpp in Firefox + */ + +//***************************************************************************** +// GPrintingPromptServiceFactory +//***************************************************************************** + +class GPrintingPromptServiceFactory : public nsIFactory +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIFACTORY + + GPrintingPromptServiceFactory(); + virtual ~GPrintingPromptServiceFactory(); +}; + +//***************************************************************************** + +NS_IMPL_ISUPPORTS1(GPrintingPromptServiceFactory, nsIFactory) + +GPrintingPromptServiceFactory::GPrintingPromptServiceFactory() +{ +} + +GPrintingPromptServiceFactory::~GPrintingPromptServiceFactory() +{ +} + +NS_IMETHODIMP GPrintingPromptServiceFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) +{ + NS_ENSURE_ARG_POINTER(aResult); + + *aResult = NULL; + GPrintingPromptService *inst = new GPrintingPromptService; + if (!inst) + return NS_ERROR_OUT_OF_MEMORY; + + nsresult rv = inst->QueryInterface(aIID, aResult); + if (rv != NS_OK) { + // We didn't get the right interface, so clean up + delete inst; + } + + return rv; +} + +NS_IMETHODIMP GPrintingPromptServiceFactory::LockFactory(PRBool lock) +{ + return NS_OK; +} + +//***************************************************************************** + +nsresult NS_NewPrintingPromptServiceFactory(nsIFactory** aFactory) +{ + NS_ENSURE_ARG_POINTER(aFactory); + *aFactory = nsnull; + + GPrintingPromptServiceFactory *result = new GPrintingPromptServiceFactory; + if (!result) + return NS_ERROR_OUT_OF_MEMORY; + + NS_ADDREF(result); + *aFactory = result; + + return NS_OK; +} + +/* + * End of adapted code. + */ + +static NS_DEFINE_CID(kGPrintingPromptServiceCID, G_PRINTINGPROMPTSERVICE_CID); + +void +yelp_register_printing () +{ + nsresult rv; + nsCOMPtr<nsIComponentRegistrar> cr; + rv = NS_GetComponentRegistrar(getter_AddRefs(cr)); + NS_ENSURE_SUCCESS (rv, ); + + nsCOMPtr<nsIComponentManager> cm; + rv = NS_GetComponentManager (getter_AddRefs (cm)); + NS_ENSURE_SUCCESS (rv, ); + + nsCOMPtr<nsIFactory> componentFactory; + rv = NS_NewPrintingPromptServiceFactory(getter_AddRefs(componentFactory)); + + if (NS_FAILED(rv) || !componentFactory) + { + g_warning ("Failed to make a factory for %s\n", G_PRINTINGPROMPTSERVICE_CLASSNAME); + return; + } + + rv = cr->RegisterFactory(kGPrintingPromptServiceCID, + G_PRINTINGPROMPTSERVICE_CLASSNAME, + G_PRINTINGPROMPTSERVICE_CONTRACTID, + componentFactory); + if (NS_FAILED(rv)) + { + g_warning ("Failed to register %s\n", G_PRINTINGPROMPTSERVICE_CLASSNAME); + } + +} + +#endif Index: yelp-2.30.2/src/yelp-gecko-utils.cpp =================================================================== --- yelp-2.30.2.orig/src/yelp-gecko-utils.cpp +++ yelp-2.30.2/src/yelp-gecko-utils.cpp @@ -213,8 +213,8 @@ yelp_gecko_init (void) nsresult rv; #ifdef XPCOM_GLUE static const GREVersionRange greVersion = { - "1.9a", PR_TRUE, - "2", PR_TRUE + "2.0a", PR_TRUE, + "2.0", PR_TRUE }; char xpcomLocation[PATH_MAX]; rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, sizeof (xpcomLocation)); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org