bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: behaviour of "info" makes it hard to migrate to $prefix/share/info


From: Eli Zaretskii
Subject: Re: behaviour of "info" makes it hard to migrate to $prefix/share/info
Date: Sat, 29 Jan 2005 19:05:36 +0200

> From: Bruno Haible <address@hidden>
> Date: Sat, 29 Jan 2005 16:22:02 +0100
> 
> The way "info" interprets dir files makes it hard to migrate from
> $prefix/info to $prefix/share/info.

I don't think this has anything to do with interpretation.  This has
everything to do with invalid DIR files.  See below.

> The /tmp/prefix/share/info/dir, created by GCL the old way (using
> "echo ... >> dir" commands), looks like this:
> 
> ========================= /tmp/prefix/share/info/dir =========================
> * GCL Doc: (gcl-si.info).       GNU Common Lisp specific Documentation.
> * GCL TK Doc: (gcl-tk.info).    TK window GCL interface.
> * GCL Ansi Doc: (gcl.info).  Ansi Common Lisp Specification.
> ==============================================================================

This DIR file is invalid on two counts:

  . It lacks the "* Menu:" label
  . It lacks the node separator and the node header that should follow.

> Even if this file is malformed, there is no reason why info should not
> try the other directories from $INFOPATH after /tmp/prefix/share/info.

Info does try the other directories from $INFOPATH (I just verified
this by stepping through the code with GDB); see dir.c.  The problem
is that Info tries to create a single node from all the DIR files it
finds along $INFOPATH, and the code which does that requires the
"* Menu:" line and the node separator in each DIR file it encounters.

> If this file is malformed, the error message should mention it, through
> something like
>    "info: invalid contents of /tmp/prefix/share/info/dir: Cannot find node 
> `Top'."
> rather than
>    "info: Cannot find node `Top'."
> I mean, without a filename in the error message, the problem is hard to debug:
> in the example above "info texinfo" broke although nothing in the directory
> containing the texinfo info file had changed.

I agree that adding an error message would be good in this case.  Does
the following patch give good results?

2005-01-29  Eli Zaretskii  <address@hidden>

        * info/dir.c (add_menu_to_file_buffer): If the DIR file being
        examined is invalid, display an error message to that effect.

--- dir.c~0     2004-04-11 20:56:44.000000000 +0300
+++ dir.c       2005-01-29 19:00:56.000000000 +0200
@@ -202,7 +202,11 @@ add_menu_to_file_buffer (char *contents,
 
       /* If not even a single node separator, give up. */
       if (fb_offset == -1)
-        return;
+       {
+         info_error ((char *) _("`%s' seems to be an invalid DIR file"),
+                     fb->fullpath, NULL);
+         return;
+       }
 
       fb_binding.start = fb_offset;
       fb_binding.start +=




reply via email to

[Prev in Thread] Current Thread [Next in Thread]