After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 76331 - Links at end of manpages broken using Yelp.
Links at end of manpages broken using Yelp.
Status: RESOLVED FIXED
Product: libgnome
Classification: Deprecated
Component: general
unspecified
Other Solaris
: High major
: 2.0.0
Assigned To: Anders Carlsson
Malcolm Tredinnick
: 80217 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-03-25 21:25 UTC by keelin.boyle
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.98 KB, patch)
2002-04-05 00:19 UTC, Yogeesh
none Details | Review
proposed patch (2.62 KB, patch)
2002-05-07 11:12 UTC, Yogeesh
none Details | Review
proposed patch (2.99 KB, patch)
2002-05-08 09:34 UTC, Yogeesh
none Details | Review

Description keelin.boyle 2002-03-25 21:25:13 UTC
using yelp version 0.3 on beta2

Links in yelp at end of manpages broken.

To reproduce:

1) Start yelp.
2) Select links -> Manual Pages -> Applications ->  Java(1)
3) Scroll to end of Java manual page and click on javah(1) link, it's
broken, yet clicking the "Home" toolbar button and selecting the same link
-> Manual Pages -> Applications -> javah(1) the man page is shown.

The broken link gives the error "The document javah could not be found. It
may have been removed from your system". 

NB: Document definately installed as it can be found by direct link.
Comment 1 keelin.boyle 2002-03-25 21:33:27 UTC
When user clicks on broken link, console reports

usage: man [-] [adFlrt] [-M path] etc........

implying man command not being given correct arguments.
Comment 2 Luis Villa 2002-03-26 20:52:37 UTC
This is probably another linux/solaris format difference. Moving to
urgent to force wipro to inspect the problem.
Comment 3 Luis Villa 2002-03-31 05:52:59 UTC
I forgot; this should be under yelp, not help-browser.
Comment 4 Mikael Hallendal 2002-04-01 23:56:41 UTC
hmm .. I would guess this is really a problem in libgnome, that
gnome2-man2html creates broken links.

I will have to reinvestigate this, will get back to if it's a yelp or
a libgnome-bug.

Comment 5 Yogeesh 2002-04-05 00:19:03 UTC
Created attachment 7561 [details] [review]
proposed patch
Comment 6 Mikael Hallendal 2002-04-10 11:58:47 UTC
adding andersca since he is libgnome-maintainer. (and I suck at
autoconf-stuff :)
Comment 7 Mikael Hallendal 2002-04-11 09:35:42 UTC
moved to libgnome
Comment 8 Luis Villa 2002-04-11 16:56:20 UTC
Reassigning to andersca as well.
Comment 9 Luis Villa 2002-04-13 02:41:56 UTC
Oh, and Keelin, are you still seeing this? It seems to work here on Linux.
Comment 10 Mikael Hallendal 2002-04-13 10:20:38 UTC
not that it really has anything to do with this patch, I'm thinking of
moving in the gnome2-man2html into Yelp and make it an internal
function of Yelp for now. This gives me better control of the
error-messages and such and can take better steps in informing the
user about them.
Comment 11 Raja R Harinath 2002-04-19 15:34:56 UTC
The proposed patch should never go in.

* Please write a proper autoconf check for what parameters 'man'
accepts. Never ever invoke the 'host' command inside 'configure.in'.
If there is a POSIX standard for what you're looking for, start with that.

* Don't violate C {} nesting with an #ifdef.
Comment 12 Luis Villa 2002-04-22 06:02:48 UTC
Moving down to high; would still be good to get patched and applied,
though, if it is done correctly.
Comment 13 Anders Carlsson 2002-04-22 09:53:50 UTC
I agree with raja here, but it should be fixed.
Comment 14 Mikael Hallendal 2002-04-28 22:12:38 UTC
ok, so does anyone have another fix for this or can inform me on how
to do it?

Raja, could you suply a better solution?
Comment 15 Mikael Hallendal 2002-05-01 03:02:46 UTC
*** Bug 80217 has been marked as a duplicate of this bug. ***
Comment 16 Luis Villa 2002-05-01 10:55:49 UTC
Fairly major and we have a patch that would work, even if ugly, so
leaving 2.0.0 but please feel free to punt to 2.0.1 if you don't think
this will/should happen
Comment 17 Raja R Harinath 2002-05-03 16:12:26 UTC
The 'configure.in' part of the code is:

  AC_CANONICAL_HOST
  case $host in
  *-linux-gnu | *-irix6*) AC_DEFINE(HAVE_MAN_WHEREIS, [man(1)
understands -w option]);;
  *-solaris*) AC_DEFINE(HAVE_MAN_DEBUG, [man(1) has a -d debug option]);;
  esac

There's no need to patch Makefile.am.

The C part of the code is: somewhere add this code

  #if defined HAVE_MAN_WHEREIS
  #define MAN_CAN_FIND_SOURCE
  const char *man_source_locator = "man -w %s";
  const char *man_source_locator_with_section = "man -w %c %s";
  #elif defined HAVE_MAN_DEBUG
  #define MAN_CAN_FIND_SOURCE
  const char *man_source_locator = "man -d %s | sed -n 's,^[
\t]*unformated[ \t]*=[ \t]*,,p'";
  const char *man_source_locator_with_section = "man -d -s %c %s | ...";
  #endif

and below, replace 

  snprintf(cmdline, sizeof(cmdline), "man -w %c %s", section, infile);

with

  #ifdef MAN_CAN_FIND_SOURCE
  snprintf(cmdline, sizeof(cmdline), man_source_locator_with_section,
section, infile);
  #else
  // do whatever necessary to indicate that the function failed
  #endif

Hopefully the folks at Wipro can put together a patch from this, test
it, etc.  I can't do it right now since I haven't yet set up my source
tree.

Again, irrespective of urgency, no way should ugly, unmaintainable
code go in.

(BTW, to the Wipro guys who may be interested, in the 'sun-patches'
directory, 

  grep -l uname */*.diff

gives me

  gnome-utils/073-70827-w.diff
  libgnome/074-76331-w.diff
  nautilus/122-00000-w.diff

They should be treated similarly.)
Comment 18 Raja R Harinath 2002-05-03 16:16:32 UTC
Sorry about the wordwrap.

  *-linux-gnu | *-irix6*) 
     AC_DEFINE(HAVE_MAN_WHEREIS, [man(1) understands -w option]);;

...

  #elif defined HAVE_MAN_DEBUG
  #define MAN_CAN_FIND_SOURCE
  const char *man_source_locator = "man -d %s " 
             "| sed -n 's,^[ \t]*unformated[ \t]*=[ \t]*,,p'";
  const char *man_source_locator_with_section = "man -d -s %c %s "
             "| ...";
  #endif

(though it may be obvious what I meant.)
Comment 19 Raja R Harinath 2002-05-03 16:22:09 UTC
Sorry again.  I'm typing from memory.  So, you'll have to forgive
small mistakes in the suggestions.

The syntax for AC_DEFINE is something like

     AC_DEFINE(HAVE_MAN_WHEREIS, 1, [man(1) understands -w option]);;
Comment 20 Yogeesh 2002-05-07 11:12:06 UTC
Created attachment 8247 [details] [review]
proposed patch
Comment 21 Raja R Harinath 2002-05-07 14:53:34 UTC
I think you missed my last message.

 --- libgnome/acconfig.h	Thu Nov  1 00:29:31 2001
 +++ libgnome_new/acconfig.h	Tue May  7 16:22:24 2002
 +#undef HAVE_MAN_WHEREIS 
 +#undef HAVE_MAN_DEBUG
 +#undef MAN_CAN_FIND_SOURCE

Please don't touch acconfig.h.

  --- libgnome/configure.in	Mon May  6 00:08:00 2002  
  +++ libgnome_new/configure.in	Tue May  7 16:20:52 2002
  @@ -44,6 +44,12 @@ AC_SUBST(LIBGNOME_CURRENT)

+AC_CANONICAL_HOST
+   case $host in
+   *-linux-gnu | *-irix6*) AC_DEFINE(HAVE_MAN_WHEREIS, [man(1) 
understands -w option]);;
+   *-solaris*) AC_DEFINE(HAVE_MAN_DEBUG, [man(1) has a -d debug
option]);;
+   esac

Change these to

  AC_DEFINE(HAVE_MAN_WHEREIS, 1, [man(1) understands -w option]);;

and

  AC_DEFINE(HAVE_MAN_DEBUG, 1, [man(1) has a -d debug option]);;

(note the '1')

Also, in

+#ifdef MAN_CAN_FIND_SOURCE
+
	    g_snprintf(cmdline, sizeof(cmdline),
man_source_locator_with_section, section, infile);
+#else
+
g_message("Path for man page not found"); 
+#endif

The alternative has bad indentation.  The code there appears to be
incomplete.  I'm sure you want to do more than just show a message. 
You don't want the 'popen' further down to run on an uninitialized
'cmdline'.  You probably want this code (cut-and-pasted from further
down in the same file):

          {
            printf("<HTML><HEAD><TITLE>Document not found</TITLE>\n"
                   "</HEAD><BODY>"
                   "I don't know how to find the document \"%s\" "
                   "on your system.\n"
                   "</BODY></HTML>\n", infile);

                return 4;
          }
Comment 22 Yogeesh 2002-05-08 09:34:40 UTC
Created attachment 8278 [details] [review]
proposed patch
Comment 23 Raja R Harinath 2002-05-08 13:19:43 UTC
Please fix indentation.  Otherwise looks OK.

I guess it can be committed once all variants are tested (temporarily
unset MAN_CAN_FIND_SOURCE and check to see if it compiles and runs).

Anders?
Comment 24 Anders Carlsson 2002-05-13 12:29:31 UTC
I've committed this to CVS now.