diff options
author | Marinus Schraal <foser@gentoo.org> | 2003-11-17 22:39:11 +0000 |
---|---|---|
committer | Marinus Schraal <foser@gentoo.org> | 2003-11-17 22:39:11 +0000 |
commit | 04fb822090b2babd6e85fc1180eb4510aa4f6d13 (patch) | |
tree | a741ea04757617b6ae9a672d2a963093ec2180c4 /gnome-extra | |
parent | new release 'n cleanup (diff) | |
download | gentoo-2-04fb822090b2babd6e85fc1180eb4510aa4f6d13.tar.gz gentoo-2-04fb822090b2babd6e85fc1180eb4510aa4f6d13.tar.bz2 gentoo-2-04fb822090b2babd6e85fc1180eb4510aa4f6d13.zip |
new release 'n cleanup
Diffstat (limited to 'gnome-extra')
-rw-r--r-- | gnome-extra/yelp/ChangeLog | 8 | ||||
-rw-r--r-- | gnome-extra/yelp/Manifest | 4 | ||||
-rw-r--r-- | gnome-extra/yelp/files/digest-yelp-2.2.3 | 1 | ||||
-rw-r--r-- | gnome-extra/yelp/files/digest-yelp-2.4.2 | 1 | ||||
-rw-r--r-- | gnome-extra/yelp/files/yelp-2-speed_fix.patch | 521 | ||||
-rw-r--r-- | gnome-extra/yelp/yelp-2.4.2.ebuild (renamed from gnome-extra/yelp/yelp-2.2.3.ebuild) | 23 |
6 files changed, 548 insertions, 10 deletions
diff --git a/gnome-extra/yelp/ChangeLog b/gnome-extra/yelp/ChangeLog index 3bbfaf317cef..63cd494e9ae9 100644 --- a/gnome-extra/yelp/ChangeLog +++ b/gnome-extra/yelp/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for gnome-extra/yelp # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/ChangeLog,v 1.44 2003/11/15 03:13:41 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/ChangeLog,v 1.45 2003/11/17 22:39:03 foser Exp $ + +*yelp-2.4.2 (17 nov 2003) + + 17 Nov 2003; foser <foser@gentoo.org> yelp-2.4.0.ebuild : + New version + Experimental patch added to speed up browsing 14 Nov 2003; Aron Griffis <agriffis@gentoo.org> yelp-2.4.0.ebuild: Stable on ia64 diff --git a/gnome-extra/yelp/Manifest b/gnome-extra/yelp/Manifest index d9753f8bf4e9..db0820027a52 100644 --- a/gnome-extra/yelp/Manifest +++ b/gnome-extra/yelp/Manifest @@ -1,8 +1,8 @@ MD5 a13befa0c69be4ed23731ba28ec69653 yelp-2.2.2.ebuild 739 MD5 fe49b3845a5b0c049ae10e8b94e2b004 yelp-2.4.0.ebuild 780 -MD5 fff77b2c5e4134a99bebd26f94a34bf5 yelp-2.4.2.ebuild 862 +MD5 7b65650eb627be422f61c3b331b37e72 yelp-2.4.2.ebuild 864 MD5 6afb7958609f26243b5dd6a0c0ab4498 yelp-2.2.0.ebuild 748 -MD5 81517d218766775729cf20a19281dd7f ChangeLog 4936 +MD5 28aa08e9c70632af533f532a82b7b0b2 ChangeLog 4933 MD5 03ad2e6c4ab41244af1015a8bbb0b39f metadata.xml 158 MD5 3910f0fbbd1f1d70a37f501a0769f936 yelp-2.4.1.ebuild 775 MD5 8419eadd0bd13b4b812ed33d93b503dd files/digest-yelp-2.2.0 63 diff --git a/gnome-extra/yelp/files/digest-yelp-2.2.3 b/gnome-extra/yelp/files/digest-yelp-2.2.3 deleted file mode 100644 index a4baad77a910..000000000000 --- a/gnome-extra/yelp/files/digest-yelp-2.2.3 +++ /dev/null @@ -1 +0,0 @@ -MD5 46727cccf4e8d17ec5102e8274b5145c yelp-2.2.3.tar.bz2 523136 diff --git a/gnome-extra/yelp/files/digest-yelp-2.4.2 b/gnome-extra/yelp/files/digest-yelp-2.4.2 new file mode 100644 index 000000000000..060f7a4c11fd --- /dev/null +++ b/gnome-extra/yelp/files/digest-yelp-2.4.2 @@ -0,0 +1 @@ +MD5 ee89f4d0886f7c3be1b9f6894a57ec1b yelp-2.4.2.tar.bz2 598274 diff --git a/gnome-extra/yelp/files/yelp-2-speed_fix.patch b/gnome-extra/yelp/files/yelp-2-speed_fix.patch new file mode 100644 index 000000000000..4cfc284b56ff --- /dev/null +++ b/gnome-extra/yelp/files/yelp-2-speed_fix.patch @@ -0,0 +1,521 @@ +? yelp-shaunm-030816-0.diff +Index: src/yelp-cache.c +=================================================================== +RCS file: /cvs/gnome/yelp/src/yelp-cache.c,v +retrieving revision 1.2 +diff -u -r1.2 yelp-cache.c +--- src/yelp-cache.c 13 Jun 2003 17:15:00 -0000 1.2 ++++ src/yelp-cache.c 16 Aug 2003 22:04:15 -0000 +@@ -30,11 +30,17 @@ + GHashTable *cache_table; + GMutex *cache_mutex; + ++GHashTable *links_table; ++GMutex *links_mutex; ++ + void + yelp_cache_init (void) + { + cache_mutex = g_mutex_new (); + cache_table = g_hash_table_new (g_str_hash, g_str_equal); ++ ++ links_mutex = g_mutex_new (); ++ links_table = g_hash_table_new (g_str_hash, g_str_equal); + } + + const gchar * +@@ -51,6 +57,20 @@ + return ret_val; + } + ++YelpNavLinks * ++yelp_cache_lookup_links (const gchar *path) ++{ ++ YelpNavLinks *ret_val; ++ ++ g_mutex_lock (links_mutex); ++ ++ ret_val = (YelpNavLinks *) g_hash_table_lookup (links_table, path); ++ ++ g_mutex_unlock (links_mutex); ++ ++ return ret_val; ++} ++ + void + yelp_cache_add (const gchar *path, const gchar *html) + { +@@ -59,4 +79,16 @@ + g_hash_table_insert (cache_table, (gchar *) path, g_strdup (html)); + + g_mutex_unlock (cache_mutex); ++} ++ ++void ++yelp_cache_add_links (const gchar *path, const YelpNavLinks *links) ++{ ++ YelpNavLinks *new_links; ++ ++ g_mutex_lock (links_mutex); ++ ++ g_hash_table_insert (links_table, (gchar *) path, links); ++ ++ g_mutex_unlock (links_mutex); + } +Index: src/yelp-cache.h +=================================================================== +RCS file: /cvs/gnome/yelp/src/yelp-cache.h,v +retrieving revision 1.2 +diff -u -r1.2 yelp-cache.h +--- src/yelp-cache.h 13 Jun 2003 17:15:00 -0000 1.2 ++++ src/yelp-cache.h 16 Aug 2003 22:04:15 -0000 +@@ -27,10 +27,31 @@ + + #include "yelp-uri.h" + ++typedef struct _YelpNavLinks YelpNavLinks; ++ ++#define YELP_NAV_LINKS(x) ((YelpNavLinks *) x) ++ ++struct _YelpNavLinks { ++ gchar *prev_link_uri; ++ gchar *next_link_uri; ++ gchar *prev_link_title; ++ gchar *next_link_title; ++ gchar *prev_link_text; ++ gchar *next_link_text; ++ gchar *up_link_uri; ++ gchar *up_link_title; ++}; ++ + void yelp_cache_init (void); + + const gchar * yelp_cache_lookup (const gchar *path); + + void yelp_cache_add (const gchar *path, + const gchar *html); ++ ++YelpNavLinks * yelp_cache_lookup_links (const gchar *path); ++ ++void yelp_cache_add_links (const gchar *path, ++ const YelpNavLinks *links); ++ + #endif /* __YELP_CACHE_H__ */ +Index: src/yelp-db2html.c +=================================================================== +RCS file: /cvs/gnome/yelp/src/yelp-db2html.c,v +retrieving revision 1.27 +diff -u -r1.27 yelp-db2html.c +--- src/yelp-db2html.c 24 Jul 2003 06:18:35 -0000 1.27 ++++ src/yelp-db2html.c 16 Aug 2003 22:04:15 -0000 +@@ -66,16 +66,28 @@ + const gchar *params[16 + 1]; + gchar *pathname; + gchar *docpath; ++ gboolean gen_links; + db_doc = NULL; + + putenv ("XML_CATALOG_FILES=" DATADIR "/yelp/catalog"); + + if (argc < 2) { +- g_print ("Usage 'yelp-db2html url'\n"); ++ g_print ("Usage 'yelp-db2html [-n] url'\n"); + exit (1); + } + +- docpath = argv[1]; ++ if (!strcmp (argv[1], "-n")) { ++ if (argc < 3) { ++ g_print ("Usage 'yelp-db2html [-n] url'\n"); ++ exit (1); ++ } ++ ++ docpath = argv[2]; ++ gen_links = FALSE; ++ } else { ++ docpath = argv[1]; ++ gen_links = TRUE; ++ } + + if (!g_file_test (docpath, G_FILE_TEST_EXISTS)) { + g_warning ("'%s' doesn't exist.", docpath); +@@ -126,7 +138,7 @@ + params[6] = "yelp_max_chunk_depth"; + params[7] = "2"; + params[8] = "yelp_generate_navbar"; +- params[9] = "1"; ++ params[9] = (gen_links ? "1" : "0"); + params[10] = "yelp_chunk_method"; + params[11] = "'yelp'"; + params[12] = NULL; +Index: src/yelp-reader.c +=================================================================== +RCS file: /cvs/gnome/yelp/src/yelp-reader.c,v +retrieving revision 1.28 +diff -u -r1.28 yelp-reader.c +--- src/yelp-reader.c 8 Jul 2003 12:05:49 -0000 1.28 ++++ src/yelp-reader.c 16 Aug 2003 22:04:17 -0000 +@@ -94,7 +94,7 @@ + static void reader_th_data_free (ReaderThreadData *th_data); + #endif + static gchar * reader_get_chunk (const gchar *document, +- const gchar *section); ++ YelpURI *uri); + static gchar * + reader_look_for_cached_help_file (const gchar *url); + +@@ -261,9 +261,15 @@ + break; + case YELP_URI_TYPE_DOCBOOK_XML: + case YELP_URI_TYPE_DOCBOOK_SGML: +- command_line = g_strdup_printf ("%s/yelp-db2html %s", +- SERVERDIR, +- yelp_uri_get_path (uri)); ++ if (yelp_cache_lookup_links (yelp_uri_to_string (uri))) { ++ command_line = g_strdup_printf ("%s/yelp-db2html -n %s", ++ SERVERDIR, ++ yelp_uri_get_path (uri)); ++ } else { ++ command_line = g_strdup_printf ("%s/yelp-db2html %s", ++ SERVERDIR, ++ yelp_uri_get_path (uri)); ++ } + break; + default: + /* Set error */ +@@ -312,14 +318,7 @@ + yelp_uri_get_type (uri) == YELP_URI_TYPE_DOCBOOK_SGML) { + gchar *chunk; + +- if (yelp_uri_get_section (uri) && +- strcmp (yelp_uri_get_section (uri), "")) { +- chunk = reader_get_chunk (q_data->data, +- yelp_uri_get_section (uri)); +- } else { +- chunk = reader_get_chunk (q_data->data, +- "toc"); +- } ++ chunk = reader_get_chunk (q_data->data, uri); + + g_free (q_data->data); + q_data->data = chunk; +@@ -634,25 +633,30 @@ + #endif + + static gchar * +-reader_get_chunk (const gchar *document, const gchar *section) ++reader_get_chunk (const gchar *document, YelpURI *uri) + { +- gchar *header; +- gchar *chunk; +- const gchar *footer; +- gchar *ret_val; +- const gchar *start; +- const gchar *end; +- gchar *tag; +- GTimer *timer; +- +-/* g_print ("%s\n", document); */ +- +- timer = g_timer_new (); ++ const gchar *section; ++ gchar *header; ++ gchar *chunk; ++ const gchar *footer; ++ gchar *ret_val; ++ const gchar *start; ++ const gchar *end; ++ gchar *tag; ++ GTimer *timer; ++ YelpNavLinks *links; ++ const gchar *nav_top; ++ const gchar *nav_bottom; ++ ++ // timer = g_timer_new (); ++ ++ section = yelp_uri_get_section (uri); ++ if (!section || !strcmp (section, "")) ++ section = "toc"; + + end = strstr (document, "<!-- End of header -->"); + + if (!end) { +-/* g_warning ("Wrong type of document\n"); */ + return g_strdup (document); + } + +@@ -663,7 +667,6 @@ + g_free (tag); + + if (!start) { +-/* g_warning ("Document doesn't include section: '%s'", section); */ + g_free (header); + + return g_strdup (document); +@@ -672,8 +675,6 @@ + end = strstr (start, "<!-- End of chunk -->"); + + if (!end) { +-/* g_warning ("Document is doesn't contain end tag for section: %s", */ +-/* section); */ + g_free (header); + + return g_strdup (document); +@@ -684,15 +685,59 @@ + footer = strstr (document, "<!-- Start of footer -->"); + + if (!footer) { +-/* g_warning ("Couldn't find footer in document"); */ + g_free (header); + g_free (chunk); + + return g_strdup (document); + } +- +- ret_val = g_strconcat (header, chunk, footer, NULL); +- ++ ++ links = yelp_cache_lookup_links (yelp_uri_to_string (uri)); ++ ++ if (!links) { ++ nav_top = ""; ++ nav_bottom = ""; ++ } else { ++ nav_top = g_strconcat ("<table width='100%'><tr>", ++ "<td width='40%' align='left'>", ++ "<a accesskey='p' href='", ++ links->prev_link_uri, "'>", ++ links->prev_link_title, ++ "</a></td>", ++ "<td width='40%' align='right'>", ++ "<a accesskey='n' href='", ++ links->next_link_uri, "'>", ++ links->next_link_title, ++ "</a></td>", ++ "</tr></table>", ++ "<hr>", ++ NULL); ++ nav_bottom = g_strconcat ("<hr class='bottom'>", ++ "<table width='100%'><tr>", ++ "<td width='40%' align='left'>", ++ "<a accesskey='p' href='", ++ links->prev_link_uri, "'>", ++ links->prev_link_title, ++ "</a><br>", ++ links->prev_link_text, ++ "</td>", ++ "<td width='20%' align='center'>", ++ "<a accesskey='u' href='", ++ links->up_link_uri, "'>", ++ links->up_link_title, ++ "</a></td>", ++ "<td width='40%' align='right'>", ++ "<a accesskey='n' href='", ++ links->next_link_uri, "'>", ++ links->next_link_title, ++ "</a><br>", ++ links->next_link_text, ++ "</td>", ++ "</tr></table>", ++ NULL); ++ } ++ ++ ret_val = g_strconcat (header, nav_top, chunk, nav_bottom, footer, NULL); ++ + g_free (header); + g_free (chunk); + +@@ -902,14 +947,8 @@ + } else { + document = read_document; + } +- +- if (yelp_uri_get_section (new_uri) && +- strcmp (yelp_uri_get_section (new_uri), "")) { +- chunk = reader_get_chunk (document, +- yelp_uri_get_section (new_uri)); +- } else { +- chunk = reader_get_chunk (document, "toc"); +- } ++ ++ chunk = reader_get_chunk (document, new_uri); + + g_free (read_document); + yelp_uri_unref (new_uri); +Index: src/yelp-scrollkeeper.c +=================================================================== +RCS file: /cvs/gnome/yelp/src/yelp-scrollkeeper.c,v +retrieving revision 1.34 +diff -u -r1.34 yelp-scrollkeeper.c +--- src/yelp-scrollkeeper.c 13 Jun 2003 17:15:01 -0000 1.34 ++++ src/yelp-scrollkeeper.c 16 Aug 2003 22:04:18 -0000 +@@ -593,6 +593,7 @@ + xmlNode *xml_node; + GNode *tree; + gchar *full_path; ++ gchar *title_path; + + g_return_val_if_fail (docpath != NULL, NULL); + +@@ -619,11 +620,22 @@ + xml_node = doc->xmlRootNode->xmlChildrenNode; + + full_path = g_strconcat ("ghelp:", docpath, NULL); ++ title_path = g_strconcat (full_path, "?title-page", NULL); ++ ++ g_node_append_data (tree, ++ yelp_section_new (YELP_SECTION_DOCUMENT_SECTION, ++ _("About This Document"), ++ yelp_uri_new (title_path) )); ++ g_node_append_data (tree, ++ yelp_section_new (YELP_SECTION_DOCUMENT_SECTION, ++ _("Contents"), ++ yelp_uri_new (full_path) )); + + for (; xml_node != NULL; xml_node = xml_node->next) { + scrollkeeper_parse_toc_section (tree, xml_node, full_path); + } + ++ g_free (title_path); + g_free (full_path); + + return tree; +Index: src/yelp-view-content.c +=================================================================== +RCS file: /cvs/gnome/yelp/src/yelp-view-content.c,v +retrieving revision 1.42 +diff -u -r1.42 yelp-view-content.c +--- src/yelp-view-content.c 13 Jun 2003 17:15:01 -0000 1.42 ++++ src/yelp-view-content.c 16 Aug 2003 22:04:19 -0000 +@@ -39,6 +39,7 @@ + #include "yelp-scrollkeeper.h" + #include "yelp-util.h" + #include "yelp-uri.h" ++#include "yelp-cache.h" + #include "yelp-view-content.h" + + #define d(x) +@@ -73,6 +74,9 @@ + GNode *node); + static void content_set_tree (YelpViewContent *content, + GNode *node); ++gboolean content_generate_links (GNode *node, ++ gpointer data); ++GNode * node_last_ancestor (GNode *node); + static void + content_show_uri (YelpView *view, + YelpURI *uri, +@@ -420,6 +424,98 @@ + } + } + ++ ++GNode * ++node_last_ancestor (GNode *node) ++{ ++ if (node->children) ++ return node_last_ancestor (g_node_last_child (node)); ++ else ++ return node; ++} ++ ++ ++gboolean ++content_generate_links (GNode *node, gpointer data) ++{ ++ GNode *prev_node; ++ GNode *next_node; ++ GNode *up_node; ++ YelpURI *prev_uri; ++ YelpURI *next_uri; ++ YelpURI *up_uri; ++ YelpNavLinks *links = g_new0 (YelpNavLinks, 1); ++ YelpURI *uri; ++ ++ if (!node->data) ++ return FALSE; ++ ++ uri = YELP_SECTION (node->data)->uri; ++ ++ if (yelp_cache_lookup_links (yelp_uri_to_string (uri))) ++ return FALSE; ++ ++ if (node->prev) ++ prev_node = node_last_ancestor (node->prev); ++ else if (node->parent && node->parent->data) ++ prev_node = node->parent; ++ else ++ prev_node = NULL; ++ ++ if (node->children) ++ next_node = node->children; ++ else if (node->next) ++ next_node = node->next; ++ else if (node->parent && node->parent->next) ++ next_node = node->parent->next; ++ else ++ next_node = NULL; ++ ++ if (yelp_uri_get_section (uri) && ++ strcmp (yelp_uri_get_section (uri), "") && ++ strcmp (yelp_uri_get_section (uri), "toc") && ++ strcmp (yelp_uri_get_section (uri), "title-page")) ++ up_node = g_node_nth_child (g_node_get_root (node), 1); ++ else ++ up_node = NULL; ++ ++ if (!prev_node) { ++ links->prev_link_uri = ""; ++ links->prev_link_title = ""; ++ links->prev_link_text = ""; ++ } else { ++ prev_uri = YELP_SECTION (prev_node->data)->uri; ++ links->prev_link_uri = yelp_uri_to_string (prev_uri); ++ links->prev_link_title = _("Previous"); ++ links->prev_link_text = YELP_SECTION (prev_node->data)->name; ++ } ++ ++ if (!next_node) { ++ links->next_link_uri = ""; ++ links->next_link_title = ""; ++ links->next_link_text = ""; ++ } else { ++ next_uri = YELP_SECTION (next_node->data)->uri; ++ links->next_link_uri = yelp_uri_to_string (next_uri); ++ links->next_link_title = _("Next"); ++ links->next_link_text = YELP_SECTION (next_node->data)->name; ++ } ++ ++ if (!up_node) { ++ links->up_link_uri = ""; ++ links->up_link_title = ""; ++ } else { ++ up_uri = YELP_SECTION (up_node->data)->uri; ++ links->up_link_uri = yelp_uri_to_string (up_uri); ++ links->up_link_title = YELP_SECTION (up_node->data)->name; ++ } ++ ++ yelp_cache_add_links (yelp_uri_to_string (uri), links); ++ ++ return FALSE; ++} ++ ++ + static void + content_show_uri (YelpView *view, YelpURI *uri, GError **error) + { +@@ -445,7 +541,13 @@ + gtk_widget_show (priv->tree_sw); + content_set_tree (YELP_VIEW_CONTENT (view), + node); +- ++ ++ g_node_traverse (node, ++ G_PRE_ORDER, ++ G_TRAVERSE_ALL, ++ -1, ++ (GNodeTraverseFunc) content_generate_links, ++ NULL); + } else { + if (gtk_widget_is_focus (priv->tree_sw)) { + reset_focus = TRUE; diff --git a/gnome-extra/yelp/yelp-2.2.3.ebuild b/gnome-extra/yelp/yelp-2.4.2.ebuild index 8ff16a5448f3..a14e6ad46f0a 100644 --- a/gnome-extra/yelp/yelp-2.2.3.ebuild +++ b/gnome-extra/yelp/yelp-2.4.2.ebuild @@ -1,28 +1,39 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/yelp-2.2.3.ebuild,v 1.5 2003/09/23 15:51:24 darkspecter Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/yelp-2.4.2.ebuild,v 1.1 2003/11/17 22:39:04 foser Exp $ inherit gnome2 -DESCRIPTION="Help browser for Gnome2" +DESCRIPTION="Help browser for Gnome" HOMEPAGE="http://www.gnome.org/" IUSE="" SLOT="0" LICENSE="GPL-2" -KEYWORDS="x86 ppc ~sparc ~alpha ~hppa ~amd64" +KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~amd64" RDEPEND=">=dev-libs/glib-2.0.6 - >=gnome-base/libgnomeui-2 + >=gnome-base/gconf-1.2 >=gnome-base/libgnome-2.0.2 + >=gnome-base/libgnomeui-2 >=gnome-base/gnome-vfs-2 >=gnome-base/libbonobo-2 - =gnome-extra/libgtkhtml-2.2* + =gnome-extra/libgtkhtml-2* >=dev-libs/libxslt-1.0.15 >=gnome-base/libglade-2 - dev-libs/popt" + dev-libs/popt + sys-libs/zlib" DEPEND="${RDEPEND} >=dev-util/pkgconfig-0.12.0" DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README TODO" + +src_unpack() { + + unpack ${A} + + cd ${S} + epatch ${FILESDIR}/${PN}-2-speed_fix.patch + +} |