[uw.mfcf.bugs] xh-check-package-dependencies

rbutterworth@watmath.waterloo.edu (09/30/89)

From: Ray Butterworth <rbutterworth>

I was wondering why "make install" was suddenly taking an order
of magnituder longer than it used to for trivial packages,
and found xh-check-package-dependencies.

% time xh-check-package-dependencies
10% real=0:16 usr=0.9 sys=0.8 rd=24 wr=10 mem=178 pg=4 rec=39 sw=0 sig=1 cs=79

Note that this is with no arguments,
so the 16 seconds it took to exit after doing nothing is quite understandable.

> #!/bin/csh -f
> if ( ! $?XHIER_CSH_PREAMBLE ) \
>     setenv XHIER_CSH_PREAMBLE /software/xhier/include/csh/preamble
> source $XHIER_CSH_PREAMBLE

Process tons (114 lines) of comments and macros
just so that we can "set Software=/software"
This is extrememly important since if we decide to move /software
to somewhere else we only need to change this name in one place.

> setenv PATH `$xhier_showpath UsedBy=server xhier standard`

Now this one is even more important.
We wouldn't want to leave it out or use "unsetenv PATH".
Otherwise, what would happen if some future version of the shell
doesn't have these commands built into it.

> while ( $#argv > 0 )
>     if ( ! -d ${Software}/$1:q ) then
>     echo "The ${1} package is required for the proper"
>     echo "  operation of this package; please install it."
>     endif
>     shift
> end
> exit 0

This test is fast and efficient since it simply checks for
the existence of the directory.
We all know that if /software/name exits,
it means that the "name" package has been successfully installed.

Of course, xh-check-package-dependencies is under maintenance,
not servers.  That means it is in our search rules.
I'm sure that we'll all be using it quite frequently.
And of course none of us will use aliases for it,
so it shouldn't go under servers;
it really does belong in our search rules.
(Actually I think it belongs somewhere else.)

(Does anyone realize how fast watmath would be if we
 didn't let Bill write shell scripts?)