[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]
Andrew Sayers ug55aes@cs.bham.ac.uk writes:
> Date: 15 Mar 2000 13:35:53 GMT
>
> Those of you that are keeping count have probably noticed my posts tend to
> be about putting Pop-11 on Linux, so this one won't come as a surprise to
> you...
>
> a) The latest problem I've found is that if a user existed before Pop-11
> was put on their system, then the $HOME/.Poplib directory won't exist for
> them.
That is a special case. The problem is more general. E.g. here at
Birming if a user is created who is not set up as a poplog user
initially (and not all are) then the $poplib directory will not exist
for that user either, even though poplog was there all the time.
> The standard solution to this is to copy the directory across at
> load time if it doesn't exist.
Or to use my poplog startup script 'poplog' which is a shell script put
in one of the bin directories. Then all these work:
poplog pop11
poplog eliza
poplog xved
etc. The script sets up all the environment variables before running
Pop11 and sets up one's $poplib directory to be a shared Poplib
directory. This assumes you don't want to alter vedinit.p etc.
Such a script is included with the Birmingham poplog CD, but in
an obscure location and is not automatically put in /usr/local/bin as
it probably should be when poplog is installed. It can be found in
http://www.cs.bham.ac.uk/research/poplog/man/bin/poplog
It uses /bin/csh, and should be re-written to use /bin/sh, which will be
smaller and faster.
> Is there an easy way to do this in Pop-11 (I don't know of one, and I'd
> rather not do it in the shell scripts if possible), and can anyone think
> of a reason not to do it?
Steve Leach gave an answer.
A third answer is as follows. If you wish you can put something like
this in $popsys/init.p though it will slightly slow down starting up
pop11:
;;; $popsys/init.p
;;; If the $poplib environment variable has not yet been set up
;;; define it to be ~/Poplib
unless systranslate('poplib') then
;;; using the updater of systranslate is an alternative to
;;; manipulating popenvlist.
sysfileok('~/Poplib') -> systranslate('poplib');
endunless;
;;; Check whether the $poplib directory exists
unless sysisdirectory('$poplib') then
;;; If there's no $poplib directory then copy one from the
;;; local library (assumed to exist).
sysobey('/bin/cp -rp /usr/local/poplog/local/Poplib/* $poplib')
endunless;
;;; End $popsys/init.p
NB I have not tested all that. There may be bugs in it.
It won't be a nice thing to do if $poplib is set to be your login
directory, which is the Poplog default set in
$popcom/popenv
The first conditional above could test for that and change $poplib in
that case.
> b) The large number of environment variables needed by Pop-11 is an old
> problem, but is it possible to do something like this:
>
> vars temppopenvlist = [ pop-specific environment variables ];
> file temppopenvlist in $poplib/popenvlist.p;
>
> then towards the top of init.p:
>
> load $poplib/popenvlist.p;
> [ ^^popenvlist ^^temppopenvlist ] -> popenvlist;
>
> This would at least reduce the number of sitting variables to a handful.
As Steve commented, that's an ingenious solution which will work.
temppopenvlist will have to be a list of strings of the form
['n1=v1' 'n2=v2' 'n3=v3' ...]
where each of ni is the name of an environment variable, and each of
vi is the corresponding value, e.g.
'poplocalauto=/usr/local/poplog/local/auto'
That could be done in $popsys/init.p if the same environment
variables are to be used for all users. I may experiment with that
mechanism at Birmingham, which will reduce the number of variables
setup at login time in
$poplocal/local/com/popenv
which has to be done separately for bash users in:
$poplocal/local/com/popenv.sh
That won't work for the environment variables used to decide how to
start up poplog, i.e.
$pop_pop11 $pop_prolog $pop_xved $pop_clisp $pop_pml
etc. These are used at an earlier stage than the reading of init.p
Using those to determine which saved image to run is described in
section 4 of REF SYSTEM.
That convention was adopted to allow poplog to run in a shell that
does not support aliases or functions, like early versions of
/bin/sh
As Steve often points out, this is an area of poplog/pop-11 that
needs to be re-designed.
Aaron
==
--
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk (NB: Anti Spam address)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/
|