Re: Automake VPATH, error pages install, and a parallell make race

From: <hno@dont-contact.us>
Date: Mon, 29 Oct 2001 17:45:37 +0100

Found what it is. It is the test to check if the error page is already
installed that fails. In fact it always fails when doing a VPATH
installation, but usually it fails in such manner that the error pages
is always installed and this isn't that easily noticed.

Depending on the naming of the source and prefix directories, different
results will be seen. I by chance picked a directory layout where the
script fails in such manner that the pages are not installed.

The script reads

/bin/sh ../../../../SRC/squid/SQUIDCACHE/commit/cfgaux/mkinstalldirs
/home/henrik/squid/commit/etc/errors
for f in ../../../../SRC/squid/SQUIDCACHE/commit/errors/English/ERR_*;
do \
        if test -f /home/henrik/squid/commit/etc/errors/$f ; then \
                :; \
        else \
                echo "/usr/bin/install -c -m 644 $f
/home/henrik/squid/commit/etc/errors"; \
                /usr/bin/install -c -m 644 $f
/home/henrik/squid/commit/etc/errors; \
        fi; \
done

This script cannot work, as the for loop includes path in $f, as easily
seen in the expanded test statement:

+ test -f
/home/users/h/hn/hno/sol-sunpro-gnu/etc/errors/../../../squid/errors/English/ERR_CACHE_MGR_ACCESS_DENIED

With the particuar layout I happened to use on this box the above ends
up in the source directory, not the destination directory as intended.

Obvious fix: One of

  a) Scrap the whole script, and always install the error page (quite
suitable when moving to sharedstate, a bit of doubt if we stay with
error pages in localstatedir(etc).

  b) Make the script a little bit more complicated, use `basename $f` in
the test, or first cd to the source directory to get rid of the path.

Less obvious fix

  c) Let automake deal with these files, rather than writing a custom
install target.. (maybe same as 'a'?)

I favor having the error pages plain reinstalled when you do a "make
install". This way we are ensured people always get the correct error
pages for the version they are running (yes, there sometimes are
differences). For people using custom error pages it is just as easy to
use a custom directory.

Regards
Henrik

Robert Collins wrote:
>
> On Mon, 2001-10-29 at 23:18, hno@marasystems.com wrote:
> > Robert Collins wrote:
> > >
> > > On Sat, 2001-10-27 at 20:37, Henrik Nordstrom wrote:
> > > > Hmm.. thinking about the error pages issue.. this is caused by the
> > > > extension to search for the error pages rather than having them as
> > > > targets.
> > >
> > > Are you looking at the Sun Make again? I'm still not clear on the issue/
> >
> > It fails if using a relative VPATH.
>
> What make are you using. I've just been testing this.
>
> Rob
Received on Mon Oct 29 2001 - 09:09:59 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:36 MST