Hello community, here is the log from the commit of package yelp checked in at Wed May 24 03:03:29 CEST 2006. -------- --- GNOME/yelp/yelp.changes 2006-05-11 01:49:52.000000000 +0200 +++ yelp/yelp.changes 2006-05-23 03:14:08.000000000 +0200 @@ -1,0 +2,6 @@ +Tue May 23 03:12:28 CEST 2006 - hpj@suse.de + +- Updated patch to make it show more SuSE-specific manuals if + present. Fixes Novell bug #173181. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yelp.spec ++++++ --- /var/tmp/diff_new_pack.fJsNNj/_old 2006-05-24 03:02:52.000000000 +0200 +++ /var/tmp/diff_new_pack.fJsNNj/_new 2006-05-24 03:02:52.000000000 +0200 @@ -19,7 +19,7 @@ Group: System/GUI/GNOME Autoreqprov: on Version: 2.14.0 -Release: 21 +Release: 22 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 @@ -109,6 +109,9 @@ %{prefix}/share/icons/hicolor/192x192/apps/yelp-icon-big.png %changelog -n yelp +* Tue May 23 2006 - hpj@suse.de +- Updated patch to make it show more SuSE-specific manuals if + present. Fixes Novell bug #173181. * Thu May 11 2006 - hpj@suse.de - Updated patch to address the specific case of help:// URIs with full path and a section. Also try to look for local DTDs before ++++++ yelp-2.14.0-process-suse-manuals.patch ++++++ --- /var/tmp/diff_new_pack.fJsNNj/_old 2006-05-24 03:02:52.000000000 +0200 +++ /var/tmp/diff_new_pack.fJsNNj/_new 2006-05-24 03:02:52.000000000 +0200 @@ -1,6 +1,6 @@ -diff -upr yelp-2.14.0-pre/src/yelp-toc-pager.c yelp-2.14.0-post/src/yelp-toc-pager.c ---- yelp-2.14.0-pre/src/yelp-toc-pager.c 2006-04-18 22:10:49.000000000 -0500 -+++ yelp-2.14.0-post/src/yelp-toc-pager.c 2006-04-19 00:32:46.000000000 -0500 +diff -Nurp yelp-2.14.0-pre/src/yelp-toc-pager.c yelp-2.14.0-post/src/yelp-toc-pager.c +--- yelp-2.14.0-pre/src/yelp-toc-pager.c 2006-05-22 15:11:53.000000000 -0500 ++++ yelp-2.14.0-post/src/yelp-toc-pager.c 2006-05-22 19:20:37.000000000 -0500 @@ -137,6 +137,7 @@ static GtkTreeModel * toc_pager_get_sect static gboolean toc_process_pending (YelpTocPager *pager); @@ -17,40 +17,98 @@ process_xslt, #ifdef ENABLE_SCROLLKEEPER process_read_menu, -@@ -470,6 +472,143 @@ pop_stack_frame (YelpTocPager *pager) +@@ -470,6 +472,234 @@ pop_stack_frame (YelpTocPager *pager) priv->libmenu_stack = g_slist_delete_link (priv->libmenu_stack, priv->libmenu_stack); } -+static gchar * -+suse_manual_make_meta_path (const gchar *language) ++typedef struct +{ -+ return g_strdup_printf ("/usr/share/susehelp/meta/suselinux-manual_%s", language); ++ const gchar *meta_path; ++ const gchar *doc_path; +} ++SuseDocRef; ++ ++static const gchar const *common_desktop_entry_group = "Desktop Entry"; ++static const gchar const *kde_desktop_entry_group = "KDE Desktop Entry"; ++ ++static const SuseDocRef suse_docs [] = ++{ ++ { "/usr/share/susehelp/meta/release-notes.desktop", NULL }, ++ { "/usr/share/susehelp/meta/suselinux-manual_%s/.directory", "/usr/share/doc/manual/suselinux-manual_%s/manual/index.html" }, ++ { "/usr/share/susehelp/meta/sles/admin_%s/.directory", "/opt/gnome/share/gnome/help/sles-admin/%s/book.sle.reference.html" }, ++ { "/usr/share/susehelp/meta/sled/desktop-qs_%s/cha_gnomequick.desktop", "/opt/gnome/share/gnome/help/sled-desktop-qs/%s/SLED-gnomequick/index.html" }, ++ { "/usr/share/susehelp/meta/sled/deployment_%s/.directory", "/opt/gnome/share/gnome/help/sled-deployment/%s/book.sle.reference.html" }, ++ { "/usr/share/susehelp/meta/sled/network-user_%s/.directory", "/opt/gnome/share/gnome/help/sled-network-user/%s/book.connectivity.guide.html" }, ++ { "/usr/share/susehelp/meta/sled/gnome-user_%s/.directory", "/opt/gnome/share/gnome/help/sled-gnome-user/%s/index.html" }, ++ { "/usr/share/susehelp/meta/sled/kde-user_%s/.directory", "/opt/gnome/share/gnome/help/sled-kde-user/%s/book.sled.kde_userguide.html" }, ++ { "/usr/share/susehelp/meta/release-notes.desktop", "/usr/share/doc/release-notes/SUSE_Linux_Enterprise_Desktop_10/RELEASE-NOTES.%s.html" }, ++ { "/usr/share/susehelp/meta/apparmoradmin_%s/.directory", "/opt/gnome/share/gnome/help/apparmor-admin/%s/book.apparmor.admin.html" }, ++ { NULL, NULL } ++}; + +static gchar * -+suse_manual_make_desktop_path (const gchar *language) ++suse_manual_make_meta_path (SuseDocRef *doc_ref, const gchar *language) +{ -+ gchar *meta_path; -+ gchar *desktop_path; -+ -+ meta_path = suse_manual_make_meta_path (language); -+ desktop_path = g_strdup_printf ("%s/.directory", meta_path); -+ g_free (meta_path); -+ -+ return desktop_path; ++ return g_strdup_printf (doc_ref->meta_path, language); +} + +static gchar * -+suse_manual_make_index_path (const gchar *language) ++suse_manual_make_index_path (SuseDocRef *doc_ref, const gchar *language) +{ -+ return g_strdup_printf ("/usr/share/doc/manual/suselinux-manual_%s/manual/index.html", language); -+} ++ if (!doc_ref->doc_path) { ++ GKeyFile *key_file; ++ gchar *desktop_path; ++ const gchar *desktop_entry_group; ++ gchar *doc_path = NULL; ++ gboolean result; ++ ++ /* Use DocPath from desktop file */ ++ ++ desktop_path = suse_manual_make_meta_path (doc_ref, language); ++ ++ key_file = g_key_file_new (); ++ result = g_key_file_load_from_file (key_file, desktop_path, 0, NULL); ++ ++ g_free (desktop_path); ++ ++ if (!result && !strcmp (language, "en")) { ++ /* Some docs are inconsistent - the meta file uses "en" and the index ++ * file uses "C" or vice versa. */ ++ ++ g_key_file_free (key_file); ++ ++ desktop_path = suse_manual_make_meta_path (doc_ref, "C"); ++ ++ key_file = g_key_file_new (); ++ result = g_key_file_load_from_file (key_file, desktop_path, 0, NULL); ++ ++ g_free (desktop_path); ++ } ++ ++ if (!result) ++ goto out; ++ ++ desktop_entry_group = common_desktop_entry_group; + -+static const gchar *common_desktop_entry_group = "Desktop Entry"; -+static const gchar *kde_desktop_entry_group = "KDE Desktop Entry"; ++ if (!g_key_file_has_group (key_file, desktop_entry_group)) { ++ desktop_entry_group = kde_desktop_entry_group; ++ ++ if (!g_key_file_has_group (key_file, desktop_entry_group)) ++ goto out; ++ } ++ ++ doc_path = g_key_file_get_locale_string (key_file, desktop_entry_group, "DocPath", NULL, NULL); ++ ++ out: ++ g_key_file_free (key_file); ++ return doc_path; ++ } ++ ++ return g_strdup_printf (doc_ref->doc_path, language); ++} + +static gchar * -+suse_manual_get_title (const gchar *language) ++suse_manual_get_title (SuseDocRef *doc_ref, const gchar *language) +{ + GKeyFile *key_file; + gchar *desktop_path; @@ -58,13 +116,27 @@ + gchar *title = NULL; + gboolean result; + -+ desktop_path = suse_manual_make_desktop_path (language); ++ desktop_path = suse_manual_make_meta_path (doc_ref, language); + + key_file = g_key_file_new (); + result = g_key_file_load_from_file (key_file, desktop_path, 0, NULL); + + g_free (desktop_path); + ++ if (!result && !strcmp (language, "en")) { ++ /* Some docs are inconsistent - the meta file uses "en" and the index ++ * file uses "C" or vice versa. */ ++ ++ g_key_file_free (key_file); ++ ++ desktop_path = suse_manual_make_meta_path (doc_ref, "C"); ++ ++ key_file = g_key_file_new (); ++ result = g_key_file_load_from_file (key_file, desktop_path, 0, NULL); ++ ++ g_free (desktop_path); ++ } ++ + if (!result) + goto out; + @@ -99,17 +171,25 @@ +} + +static xmlNode * -+process_suse_manual (const gchar *language) ++process_suse_manual (SuseDocRef *doc_ref, const gchar *language) +{ + gchar *title = NULL; + gchar *path = NULL; + xmlNode *node = NULL; + -+ title = suse_manual_get_title (language); ++ title = suse_manual_get_title (doc_ref, language); + if (!title) + goto out; + -+ path = suse_manual_make_index_path (language); ++ path = suse_manual_make_index_path (doc_ref, language); ++ if (!g_file_test (path, G_FILE_TEST_IS_REGULAR) && !strcmp (language, "en")) { ++ /* Some docs are inconsistent - the meta file uses "en" and the index ++ * file uses "C" or vice versa. */ ++ ++ g_free (path); ++ path = suse_manual_make_index_path (doc_ref, "C"); ++ } ++ + if (!g_file_test (path, G_FILE_TEST_IS_REGULAR)) + goto out; + @@ -129,7 +209,7 @@ + YelpTocPagerPriv *priv = YELP_TOC_PAGER (pager)->priv; + xmlNode *root_element; + gboolean found_manuals = FALSE; -+ gint i; ++ gint i, j; + + static const gchar *language [] = + { @@ -144,15 +224,26 @@ + for (i = 0; language [i]; i++) { + xmlNode *node; + -+ node = process_suse_manual (language [i]); -+ if (!node) -+ continue; -+ -+ xmlAddChild (root_element, node); -+ -+ /* We don't use this for anything right now, but it could come in handy -+ * if we want to put manuals in a branch. */ -+ found_manuals = TRUE; ++ for (j = 0; suse_docs [j].meta_path; j++) { ++ SuseDocRef *doc_ref = (SuseDocRef *) &suse_docs [j]; ++ ++ if (!strchr (doc_ref->meta_path, '%') && ++ strcmp (language [i], "en")) { ++ /* This package doesn't have per-language desktop files. ++ * Only print its desktop file once. */ ++ continue; ++ } ++ ++ node = process_suse_manual (doc_ref, language [i]); ++ if (!node) ++ continue; ++ ++ xmlAddChild (root_element, node); ++ ++ /* We don't use this for anything right now, but it could come in handy ++ * if we want to put manuals in a branch. */ ++ found_manuals = TRUE; ++ } + } + + return FALSE; /* Don't run again */ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...