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

Re: Intention to re-write /usr/sbin/install-info

Manoj Srivastava <srivasta@datasync.com> writes:
> 	The GNU install-info instslls info files in the correct info
>  directory; it makes no effort to update the dir file.

> 	The Debian install info does not install info files in the
>  correct directory -- this is already done by the normal packaging
>  process. All it does is edit the dir file in the info directory. 

Sorry to inject some fact into the discussion:

(In this mail, all references to `install-info' are to the GNU one, the
one that comes with GNU texinfo, for eg., in texinfo-3.11.tar.gz):

install-info --help gives:

  install-info [OPTION]... [INFO-FILE [DIR-FILE]]
    Install INFO-FILE in the Info directory file DIR-FILE.

The `install-info' info page says:

    `install-info' inserts menu entries from an Info file into the
  top-level `dir' file in the Info system (see the previous sections for
  an explanation of how the `dir' file works).  It's most often run as
  part of software installation, or when constructing a dir file for all
  manuals on a system.  Synopsis:

       install-info [OPTION]... [INFO-FILE [DIR-FILE]]

    If INFO-FILE or DIR-FILE are not specified, the various options
  (described below) that define them must be.  There are no compile-time
  defaults, and standard input is never used.  `install-info' can read
  only one info file and write only one dir file per invocation.

    If DIR-FILE (however specified) does not exist, `install-info'
  creates it if possible (with no entries).

Here's a Makefile fragment generated by `automake' that handles
installing *.info files.  

  #----------------begin Makefile.in excerpt ----------------------
  install-info-am: $(INFO_DEPS)
	  $(mkinstalldirs) $(infodir)
	  @for file in $(INFO_DEPS); do \
	    d=$(srcdir); \
	    for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; d
  o \
	      if test -f $$d/$$ifile; then \
		echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
		$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
	      else : ; fi; \
	    done; \
	  @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian
  ' >/dev/null 2>&1; then \
	    for file in $(INFO_DEPS); do \
	      echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
	      install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
	    done; \
	  else : ; fi
  #-----------------end Makefile.in excerpt -----------------------

Note that $infodir is by default $prefix/info, which can however be
overriden by given the --infodir=... switch to configure.  

Also, $INSTALL_DATA is something like:

  INSTALL = /home/grad04/harinath/sol2/bin/install -c

and $INSTALL here is the BSD compatible `install' that `configure'
searches for.  The -m 644 is because `install' installs files with mode
755 by default.

A `make install' in a properly configured GNU build dir would at some
point make the `install-info-am' target.  This first calls $INSTALL_DATA
to copy the info files into the appropriate $infodir directory.  It then
calls `install-info' to update the `dir' file in $infodir.

`install-info' searches the beginning few bytes of the info file,
looking for something like:

  INFO-DIR-SECTION GNU programming tools
  * Libtool: (libtool).           Generic shared library support script.

  INFO-DIR-SECTION Individual utilities
  * libtoolize: (libtool)Invoking libtoolize.     Adding libtool support.

It then puts it into the correct sections of the `dir' file:

  GNU programming tools
  * automake: (automake).         Making Makefile.in's
  * Libtool: (libtool).           Generic shared library support script.

  Individual utilities
  * aclocal: (automake)Invoking aclocal.          Generating aclocal.m4
  * libtoolize: (libtool)Invoking libtoolize.     Adding libtool support.

Now, for the proposed design of `dinstall-info' to be something like the
current `menu' system:  have a directory of files that contain the
correct `dir' entry.

Lo and behold:  you already have it in GNU install-info !!!!!

- you have the /usr/info directory filled with info files -- one .info 
   file for each package.
- Each .info file has the correct `dir' entry.


- you don't have a separate directory with a lot of small files lying
   around that carry the required info.  You have to embed it into the
   `.info' file ;-)
- Many GNU programs are well-behaved in including the DIR-ENTRY block
   into their .info files.  Most other programs _don't_ include the
   DIR-ENTRY block.

The second problem can be solved by the regular Debian pristine source
modification mechanisms.  The modifications are reasonably trivial --
add something like this into the `.texi' source file, very close to the

  @dircategory Texinfo documentation system
  * Info: (info).                 Documentation browsing system.
  @end direntry

As an example, here's the first few lines of `libtool.texi':

  \input texinfo   @c -*-texinfo-*-
  @c %**start of header
  @setfilename libtool.info
  @settitle Libtool
  @c For double-sided printing, uncomment:
  @c @setchapternewpage odd
  @c %**end of header

  @include version.texi
  @set BUGADDR the libtool mailing list @code{<bug-libtool@@gnu.ai.mit.edu>}

  @dircategory GNU programming tools
  * Libtool: (libtool).           Generic shared library support script.
  @end direntry

  @dircategory Individual utilities
  * libtoolize: (libtool)Invoking libtoolize.     Adding libtool support.
  @end direntry

Hope I haven't bored everyone to death by now.

- Hari
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: