bug-texinfo
[Top][All Lists]
Advanced

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

Re: Using GNU's install-info in Debian instead of dpkg's install-info


From: Eli Zaretskii
Subject: Re: Using GNU's install-info in Debian instead of dpkg's install-info
Date: Sat, 27 May 2006 18:11:34 +0300

> Cc: Ian Zimmerman <address@hidden>,  address@hidden,
>         address@hidden,  address@hidden
> From: Ian Zimmerman <address@hidden>
> Date: Sat, 27 May 2006 06:59:15 -0700 (PDT)
> 
> 
> Eli> The code doesn't use any regular expressions, it uses exact text
> Eli> comparison (strcmp and the like).  
> 
> It must take account of the context in some way: section names can
> appear elsewhere in the dir file.

It uses the context defined by the Info format: a menu starts with the
"\n* Menu:" header, a menu item starts with a "\n* " if the line isn't
a menu header, a section name starts with a "\n" if the line isn't one
of the above.

> I am not saying that this problem is unsolvable in theory.  I am
> saying that it is so error prone that bugs will always be present,
> and the annoyance factor of the bugs is very high if there's no
> global regeneration.

If the DIR file is invalid as far as the Info format is concerned,
then yes, the code might eventually fail.  But other than that, it is
not prone to bugs that regular expressions are prone to: i.e., it will
never catch any context except precisely as specified above.

> Eli> In a nutshell, the program reads the entire DIR file into memory,
> Eli> builds the data structure that reflects what's in the menu
> Eli> (i.e. all the sections and the menu items found in each section),
> Eli> then sorts each section alphabetically and adds the new entries in
> Eli> the right place in each section specified in the Info file or the
> Eli> command line.  Then it produces a new DIR file from the data
> Eli> structure built in memory.
> 
> Well, this is both better and worse than I thought.  Better, because
> no slicing, but worse, because parsing the whole file amplifies the
> parsing problem.

Only if the file is invalid, I think.  For such cases, there are some
safety nets in the code, although I'm sure they can be improved.

> I'd be happy with an option that regenerates the dirfile from the info
> files.  Would the GNU side accept such an option?

I think Karl already suggested precisely that.




reply via email to

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