Andreas wrote:

        Subject: typo in popenv.sk

[A slip, intending: typo in popenv.sh]

        "I think there is a typo in poplog_base/pop/com/popenv.sh in line 228.
        The three '===' are uncalled for.

   ...
   # Default for X link -- used by pglink/poplink option -xlink (or nothing)
  -POP_XLINK_EXLIBS===POP_${XLINK}_EXLIBS
   ...

I was confused by that for a while.

It's the same in both V15 and V16, and I now realise it is not a typo.

I also checked the csh version. (csh used to be the default shell for
poplog developers from about 1978 on, I think, hence no suffix (perhaps we
should add a .csh suffix linked to the version without the suffix, or the
other way round, to make things clear to new developers/maintainers).

The following is added for people who want to understand what's going on,
though most users will not need to know!

I now realise that the '===' in the .sh version is there because there are
two substitutions in intermediate scripts before the final use of the
environment variable:

          -POP_XLINK_EXLIBS

This version (for csh/tcsh)

        $usepop/pop/com/popenv

has only two '=' because the quoting is explicit, using "
i.e.

        setenv POP_XLINK_EXLIBS "==POP_${XLINK}_EXLIBS"

I think that's a clue that in the sh version the first '=' in '===' is
there to indicate a definition, and the actual value being assigned is

        ==POP_${XLINK}_EXLIBS

as in the csh version.

Presumbably that gets inserted in another context where

        ==POP_${XLINK}_EXLIBS
is a sort of shorthand for
        = '=POP_${XLINK}_EXLIBS'

I know that there are several contexts e.g. in

        $usepop/pop/com  ( == $popcom)
        $usepop/pop/extern/lib
        $usepop/pop/src/newpop
        $usepop/pop/pop/popenv.sh
        $usepop/pop/pop/pglink

where environment variables are used that may have been inherited from
other scripts via intermediate scripts.

In part, all of this was required to allow the 'end' scripts to work with
different combinations of hardware (e.g. sun, dec, hp (hp_ux?), ibm,
mips, and others) and operating systems (e.g. vms, unix, sunos, solaris,
aix, ... linux).

I think the ability to source intermediate files allowed much less
cluttered final scripts, and also allowed changes of a particular sort to
be made in one location and inherited in several locations.

I don't think anyone outside the Sussex and ISL development teams ever had
a complete overview of the network of dependencies -- used by John Gibson
to produce a single source tree where code for any combination of hardware
and software could be found by following appropriate branches of the tree.

[NOTE
A version of it is still available here

        http://www.cs.bham.ac.uk/research/projects/poplog/src/src-master.tar.gz
        http://www.cs.bham.ac.uk/research/projects/poplog/src/AREADME.html

When the tar filed is unpacked there are many hard links, which means that
no file should edited directly: it should copied, modified, then the new
version copied back into the tree.
]END NOTE

Poplog scripts originally used the old unix shell which became csh then
tcsh and I still use it.

However, the bourne shell was developed a bit later and that became sh then
bash (and variants) and is far more widely used, with suffix '.sh' to
ensure there's no confusion.

I think we have to preseve some of the duplication for users who make use
of csh/tcsh, otherwise I would propose removing the duplication.

If we switch to using *only* sh (bash) scripts, then anyone wanting to
invoke poplog from tcsh would first have to run bash, then after all scripts
have been source run tsch and then invoke poplog.

Perhaps that should be done at some future date, but at present the network
of scripts supports both sorts of poplog user, and should probably be left
unchanged, until people like me no longer exist...

I don't know how well github can support this kind of network of
dependencies. At present I've checked and found that after V16 poplog has
been built, it can be run either using bash or tcsh, provided that the
right setup scipt is sourced initially, after defining $usepop.

At present they are
        $usepop/pop/com/poplog.sh
and
        $usepop/pop/com/poplog

(original version) now linked to
        $usepop/pop/com/poplog.csh

The link to poplog.csh was added after I downloaded Waldek's package.
Ideally, in the long run, it should be on github.

Aaron

Reply via email to