[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: install-info problems
From: |
Karl Berry |
Subject: |
Re: install-info problems |
Date: |
Fri, 26 Mar 2004 19:34:14 -0500 |
install-info: menu item `mup2ly' already exists, for file
`lilypond/lilypond'
The patch below will fix the problem for mup2ly and the other lilypond
entries, hopefully.
However, the problem still exists for
* Glossary: (lilypond/music-glossary). Glossary of music terms.
This is because install-info is not prepared to handle dir entries for
info files other than the one being processed (given on the cmd line).
I think install-info should simply read the dir entries out of the info
file, and not care what the name of the file is, but that will mean a
complete rewrite, and I really don't want to right now.
So, can I ask you to put the @direntry for Glossary in music-glossary.texi
instead of lilypond.texi? At least, I'm guessing that's the scenario.
Thanks,
karl
*** install-info.c.~1.3.~ Thu Mar 18 14:15:38 2004
--- install-info.c Fri Mar 26 16:14:37 2004
***************
*** 315,323 ****
static int
menu_item_equal (const char *item, char term_char, const char *name)
{
unsigned name_len = strlen (name);
/* First, ITEM must actually match NAME (usually it won't). */
! int ret = strncasecmp (item, name, name_len) == 0;
if (ret)
{
/* Then, `foobar' doesn't match `foo', so be sure we've got all of
--- 315,342 ----
static int
menu_item_equal (const char *item, char term_char, const char *name)
{
+ const char *item_basename = item;
unsigned name_len = strlen (name);
+
+ /* We must compare the basename in ITEM, since we are passed the
+ basename of the original info file. Otherwise, a new entry like
+ "lilypond/lilypond" won't match "lilypond".
+
+ Actually, it seems to me that we should really compare the whole
+ name, and not just the basename. Couldn't there be dir1/foo.info
+ and dir2/foo.info? Also, it seems like we should be using the
+ filename from the new dir entries, not the filename on the command
+ line. Not worrying about those things right now, though. --karl,
+ 26mar04. */
+ while (*item_basename && !IS_SLASH (*item_basename))
+ item_basename++;
+ if (! *item_basename)
+ item_basename = item; /* no /, use original */
+ else
+ item_basename++; /* have /, move past it */
+
/* First, ITEM must actually match NAME (usually it won't). */
! int ret = strncasecmp (item_basename, name, name_len) == 0;
if (ret)
{
/* Then, `foobar' doesn't match `foo', so be sure we've got all of
***************
*** 335,342 ****
{
char *suffix = suffixes[i];
unsigned suffix_len = strlen (suffix);
! ret = strncasecmp (item + name_len, suffix, suffix_len) == 0
! && item[name_len + suffix_len] == term_char;
}
}
--- 354,361 ----
{
char *suffix = suffixes[i];
unsigned suffix_len = strlen (suffix);
! ret = strncasecmp (item_basename + name_len, suffix, suffix_len) == 0
! && item_basename[name_len + suffix_len] == term_char;
}
}