bug-standards
[Top][All Lists]
Advanced

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

Re: standards for info install


From: Aubrey Jaffer
Subject: Re: standards for info install
Date: Thu, 18 Feb 2010 14:02:29 -0500 (EST)

 | Date: Thu, 18 Feb 2010 17:00:08 GMT
 | From: address@hidden (Karl Berry)
 | 
 | Here is what I've come up with for the install-info example.
 | Let me know if problems.
 | 
 | do-install-info: foo.info

Shouldn't mkinstalldirs be a dependency for do-install-info to insure
that $(DESTDIR)$(infodir)/ exists?

 |         $(NORMAL_INSTALL)
 | # There may be a newer info file in . than in srcdir.
 |         -if test -f foo.info; then d=.; \
 |          else d=$(srcdir); fi
 |         $(INSTALL_DATA) $$d/foo.info \
 |           $(DESTDIR)$(infodir)/foo.info

This isn't testing that ./foo.info is newer than $(srcdir)/foo.info;
just that ./foo.info exists.  More importantly, this code won't work
if foo.info exists.  I tried running this code in a makefile:

        d=.
        $(INSTALL_DATA) $$d/slib.info $@

and it failed:

  d=.
  install -m 644 $d/slib.info /usr/local/share/info/slib.info
  install: cannot stat `/slib.info': No such file or directory
  make: *** [/usr/local/share/info/slib.info] Error 1

Clearly, the standards.info example was not minimally adapted from a
working standards.info-conforming Makefile.  Making examples without
running and testing them frustrates readers and leads to FSF not being
taken seriously as a standards-issuing body.

 | # Run install-info only if it exists.
 | # Use `if' instead of just prepending `-' to the
 | # line so we notice real errors from install-info.
 | # Use `$(SHELL) -c' because some shells do not
 | # fail gracefully when there is an unknown command.
 |         $(POST_INSTALL)
 |         if $(SHELL) -c 'install-info --version' \
 |            >/dev/null 2>&1; then \
 |           install-info --dir-file=$(DESTDIR)$(infodir)/dir \
 |                        $(DESTDIR)$(infodir)/foo.info; \
 |         else true; fi

>From reading standards.info (ignoring this example) I come up with the
following (minimally adapted from the SLIB Makefile):

$(DESTDIR)$(infodir)/foo.info:  foo.info mkinstalldirs
        $(INSTALL_DATA) $< $@
        $(POST_INSTALL)    # Post-install commands follow.
        -install-info $@ $(DESTDIR)$(infodir)/dir
install-info:   $(DESTDIR)$(infodir)/foo.info

My code checks if $(DESTDIR)$(infodir)foo.info is newer than
./foo.info by having it as a dependency.

Someone reading standards.info is looking at examples to learn best
practices.  If the example of an installation of a single file does
not follow the text of standards.info, and contains fatal bugs to
boot, what is the reader supposed to conclude?




reply via email to

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