Re: [AD] more patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Shawn Hargreaves <shawn@xxxxxxxxxx> writes:

> But that requires all users to have at least some understanding of what 
> install-info is/does, and what the info dir file is for. I suspect that not 
> everyone will have come across this stuff before (and IMHO they shouldn't 
> have to), so it would be nice if we could do it all automatically.

I agree that adding allegro entry automatically would be a good thing.

> 
> How to other Unix packages manage this? Do they just not autoinstall the 
> info docs at all? In which case maybe we ought to follow suit and leave this 
> totally up to the user. If we are going to automate it, though, I'd like to 
> put this in the configure script and at least have it check for 
> install-info in a couple of the more obvious places before it gives
> up.

I think most of them install info files in "install-info" target (and
build info files in "info" target), and don't add entries to dir file
anywhere.

> 
> This doesn't work for me. My system has the real dir file in /etc/info-dir, 
> with /usr/info/dir a symlink to this (which was installed by default), and 
> /usr/local/info/dir another symlink to it (which was created by Allegro). If 
> I break these symlinks, the standalone info reader uses /usr/info/dir if 
> that exists, or /usr/local/info/dir if I delete /usr/info/dir, but I can't 
> see any signs of it merging the two.

I can confirm that it does not use /usr/local/info by default (there
is no mention of this directory in the executable).  I think linux
vendors decided that it would be good to have only one dir file for
the whole system and got rid of default support for several dir
files.  But all info files that come with system are already in one
directory, so I don't see why they could not just put one dir file
with all entries in /usr/info and allow for other dir files in
different directories.  Now it is necessary to set INFOPATH if one
places info file in /usr/local/info or some other directory.  For
example, if I unset INFOPATH, place allegro.info into /usr/local/info,
and add allegro entry into /usr/info/dir, it could not be found by
info reader.  Then I set INFOPATH, and all is fine.

I think we can do the following:

suggest linux users to use --infodir=/usr/info configure option (I
have not tested it yet, but it should work).  Then in install-info
in case of missing dir file just copy empty one from library source,
try different install-info from standard places, first from path, then
from /sbin and /usr/sbin, and perhaps handle difference between GNU
install-info and Debian install-info.

if test ! -e $(infodir)/dir; then
  cp $(srcdir)/docs/dir $(infodir)/dir
fi
$(INSTALL_DATA) docs/allegro.info $(infodir)
if $(SHELL) -c "install-info --version | grep 'GNU install-info'"; then
  install-info $(infodir)/allegro.info $(infodir)/dir
elif $(SHELL) -c "/sbin/install-info --version | grep 'GNU install-info'"; then
  /sbin/install-info $(infodir)/allegro.info $(infodir)/dir
...
fi

We can use configure script to search for suitable install-info, but
maybe we should not bother and just try some standard locations in
makefile.

> seems to me that creating the extra symlink in /usr/local/info is kind of 
> pointless (and as you say, this breaks on your system where that directory 
> doesn't support symlinks). Since we have already figured out where we are 
> trying to symlink it to, why can't we just point install-info at the final 
> destination of where we want that main dir file to live?

I think we should modify dir file in the directory where we place info
file.  Overwise we may have entry for allegro, but it might not work,
because info reader can not find allegro.info (not in default
INFOPATH).  When user sets INFOPATH, correct dir files from
directories mentioned in INFOPATH will be merged anyway.

-- 
Michael Bukin



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/