Hello community, here is the log from the commit of package yelp checked in at Wed Apr 23 01:56:10 CEST 2008. -------- --- GNOME/yelp/yelp.changes 2008-04-11 14:35:35.000000000 +0200 +++ /mounts/work_src_done/STABLE/yelp/yelp.changes 2008-04-23 01:35:50.852683000 +0200 @@ -1,0 +2,9 @@ +Wed Apr 23 01:40:41 CEST 2008 - vuntz@suse.de + +- Drop yelp-2.18.1-empty-doc-crash.patch: doesn't apply anymore and + seems to be fixed upstream now (crash not reproducable). +- Tag yelp-2.13.5-use-susehelp.patch. +- Add yelp-handle-help-uri.patch to handle help: URIs. Based on + some code from yelp-suse-20060319.patch. + +------------------------------------------------------------------- Old: ---- yelp-2.18.1-empty-doc-crash.patch New: ---- yelp-handle-help-uri.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yelp.spec ++++++ --- /var/tmp/diff_new_pack.X14591/_old 2008-04-23 01:55:48.000000000 +0200 +++ /var/tmp/diff_new_pack.X14591/_new 2008-04-23 01:55:48.000000000 +0200 @@ -18,7 +18,7 @@ License: GPL v2 or later; LGPL v2.1 or later Group: System/GUI/GNOME Version: 2.22.1 -Release: 1 +Release: 5 Summary: The GNOME 2.x Desktop Help Browser Source: ftp://ftp.gnome.org/pub/GNOME/sources/yelp/2.12/%{name}-%{version}.tar.bz2 Source1: help-title.png @@ -26,14 +26,15 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build # PATCH-FIX-UPSTREAM bgo522994 vuntz@novell.com -- hide menu entry outside of GNOME Patch2: yelp-onlyshowin.patch -# PATCH-NEEDS-REBASE yelp-suse-20060319.patch -- so old that maybe it can be dropped +# PATCH-NEEDS-REBASE yelp-suse-20060319.patch -- so old that maybe it can be dropped -- vuntz: keeping the patch for now, as a reference if there are some other issues. It's being replaced by other patches like yelp-handle-help-uri.patch Patch4: yelp-suse-20060319.patch Patch5: yelp-desktop.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-NEEDS-REBASE yelp-2.14.0-process-suse-manuals.patch -- so old that maybe it can be dropped +# PATCH-NEEDS-REBASE yelp-2.14.0-process-suse-manuals.patch -- so old that maybe it can be dropped -- vuntz: working on fixing it in the manuals Patch8: yelp-2.14.0-process-suse-manuals.patch -# PATCH-NEEDS-REBASE yelp-2.18.1-empty-doc-crash.patch -- so old that maybe it can be dropped -Patch10: yelp-2.18.1-empty-doc-crash.patch +# PATCH-FEATURE-OPENSUSE yelp-handle-help-uri.patch vuntz@novell.com -- handle help: URI +Patch9: yelp-handle-help-uri.patch PreReq: filesystem gconf2 Requires: gnome-doc-utils Requires: libbeagle >= 0.2.0 @@ -69,7 +70,7 @@ %patch5 %patch6 -p1 #%patch8 -p1 -#%patch10 -p1 +%patch9 -p1 # Use nds for Low Saxon (Northern Frisian Enclave) # Northern Frisian Enclave is not ISO-3166 country code: rename nds@NFE nds po/nds@NFE.* @@ -109,6 +110,12 @@ %files lang -f %{name}.lang %changelog +* Wed Apr 23 2008 vuntz@suse.de +- Drop yelp-2.18.1-empty-doc-crash.patch: doesn't apply anymore and + seems to be fixed upstream now (crash not reproducable). +- Tag yelp-2.13.5-use-susehelp.patch. +- Add yelp-handle-help-uri.patch to handle help: URIs. Based on + some code from yelp-suse-20060319.patch. * Fri Apr 11 2008 vuntz@suse.de - Update to version 2.22.1: + Don't launch external programs under GDM (bgo#525447) ++++++ yelp-handle-help-uri.patch ++++++ Handle help: URI. They are used by KDE apps, and susehelp. It's a bit hackish to have to handle things this way, and hopefully a common doc metadata format will solve this kind of issues in the future. diff -aurp yelp-2.22.1/src/yelp-utils.c yelp-2.22.1-patched//src/yelp-utils.c --- yelp-2.22.1/src/yelp-utils.c 2008-04-07 20:02:52.000000000 +0200 +++ yelp-2.22.1-patched//src/yelp-utils.c 2008-04-23 01:09:41.000000000 +0200 @@ -40,6 +40,8 @@ YelpRrnType resolve_process_ghelp (char *uri, gchar **result); +static void resolve_process_help (gchar *uri, + gchar **result); gchar * resolve_get_section (const gchar *uri); gboolean resolve_is_man_path (const gchar *path, const gchar *encoding); @@ -315,6 +317,25 @@ yelp_uri_resolve (gchar *uri, gchar **re if (*result) { *section = intern_section; } + } else if (!strncmp (uri, "help:", 4)) { + resolve_process_help (intern_uri, result); + /* we got a file: uri, so let's redo the resolve process */ + if (*result) { + gchar *buf1 = NULL; + gchar *buf2 = NULL; + + ret = yelp_uri_resolve (*result, &buf1, &buf2); + + g_free (*result); + *result = buf1; + + if (ret == YELP_RRN_TYPE_ERROR) + *section = NULL; + else if (ret == YELP_RRN_TYPE_EXTERNAL) + *section = NULL; + else + *section = intern_section; + } } else if (!strncmp (uri, "man:", 4)) { ret = resolve_man_page (&uri[4], result, section); if (ret == YELP_RRN_TYPE_ERROR) { @@ -439,3 +460,204 @@ yelp_uri_resolve (gchar *uri, gchar **re return ret; } + +static gchar * +help_uri_check_file (gchar *filename) { + if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { + gchar *full_uri; + full_uri = g_strconcat ("file://", filename, NULL); + return full_uri; + } + + return NULL; +} + +static gchar * +help_uri_check_dir (gchar *path, gchar *identifier) +{ + gchar *result; + gchar *full_path; + gchar *full_identifier; + + result = help_uri_check_file (path); + if (result) + return result; + + full_path = g_build_filename (path, "index.docbook", NULL); + result = help_uri_check_file (full_path); + g_free (full_path); + if (result) + return result; + + full_identifier = g_strconcat (identifier, ".xml", NULL); + full_path = g_build_filename (path, full_identifier, NULL); + result = help_uri_check_file (full_path); + g_free (full_path); + g_free (full_identifier); + if (result) + return result; + + full_path = g_build_filename (path, "index.html", NULL); + result = help_uri_check_file (full_path); + g_free (full_path); + if (result) + return result; + + full_identifier = g_strconcat (identifier, ".html", NULL); + full_path = g_build_filename (path, full_identifier, NULL); + result = help_uri_check_file (full_path); + g_free (full_path); + g_free (full_identifier); + if (result) + return result; + + return NULL; +} + +static gchar * +help_uri_search (gchar *path, gchar *identifier) +{ + gchar *result; + + result = help_uri_check_dir (path, identifier); + if (result) + return result; + + if (g_str_has_suffix (path, ".html")) { + gchar *slash = strrchr (path, '/'); + if (slash != NULL) { + gchar *shortened = g_strndup (path, slash - path); + result = help_uri_check_dir (shortened, identifier); + g_free (shortened); + if (result) + return result; + } + } + return NULL; +} + +static gchar * +help_uri_expand_datadirs (gchar *path, gchar *identifier) +{ + char const* const* data_dirs = g_get_system_data_dirs (); + int i; + gchar *result; + + for (i = 0; data_dirs[i]; i++) { + char *full_path = g_build_filename (data_dirs[i], path, NULL); + result = help_uri_search (full_path, identifier); + g_free (full_path); + if (result) + return result; + } + return NULL; +} + +static void +resolve_process_help (gchar *uri, gchar **result) +{ + gchar *path; + gchar *file_name = NULL; + const gchar * const * langs; + gchar *full_path; + int i; + + if ((path = strchr(uri, ':'))) + path++; + else + return; + + while (*path == '/') + path++; + + path = g_strdup (path); + g_strstrip (path); + + if (!*path) { + g_free (path); + return; + } + + full_path = g_strconcat ("/", path, NULL); + *result = help_uri_check_file (full_path); + g_free (full_path); + if (*result) + goto end; + + /* This isn't the filename so much as the rest of the path after the first + * bit of the path. */ + file_name = strchr (path, '/'); + if (file_name) { + *file_name = 0; + file_name ++; + } else { + file_name = ""; + } + + langs = g_get_language_names (); + + for (i = 0; langs[i] != NULL; i++) { + full_path = g_strdup_printf ("/gnome/help/%s/%s/%s", path, langs[i], file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/gnome/help-bundle/%s/%s/%s", path, langs[i], file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/doc/kde/HTML/%s/%s/%s", langs[i], path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/doc/HTML/%s/%s/%s", langs[i], path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/doc-bundle/HTML/%s/%s/%s", langs[i], path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + } + + full_path = g_strdup_printf ("/gnome/help/%s/C/%s", path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/gnome/help-bundle/%s/C/%s", path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/doc/kde/HTML/en/%s/%s", path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/doc/HTML/en/%s/%s", path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + full_path = g_strdup_printf ("/doc-bundle/HTML/en/%s/%s", path, file_name); + *result = help_uri_expand_datadirs (full_path, path); + g_free (full_path); + if (*result) + goto end; + + end: + g_free (path); +} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org