discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Proposal question.


From: Richard Frith-Macdonald
Subject: Re: Proposal question.
Date: Fri, 10 May 2002 04:18:13 +0100

On Friday, May 10, 2002, at 02:53 AM, Pascal Bourguignon wrote:
It  seems to  me that's  another  kind of  problem we  have here.   In
general,  how can  GNUSTEP_USER_ROOT  be  changed on  the  fly, for  a
running application ?

By the same  token as programs such as apache,  login, sshd, etc, have
to  do  something  special  when  they change  their  (E)UID,  GNUstep
(server) programs will have to  do themselves.  I don't think that the
GNUstep library can do anything general here.

The point is, what happens  if after the initialization of GNUstep and
NSApplication, the program does a:

     setenv("GNUSTEP_USER_ROOT","/new/place/for/gnustep/user/root",1);

That's not really related to this ... setenv() has no effect on the
environment provides by NSProcessInfo or used by NSTask.  It would
effect any code using getenv(), but not code using the GNUstep/OpenStep
API.

What you're asking is twofold:

   - a way for a program to change GNUSTEP_USER_ROOT on the fly,

   - a  way for  a given  program  to know  what GNUSTEP_USER_ROOT  it
     should use at a given time.

I don't know for the first question how GNUstep would behave.

GSSetUser() handles the first question.

For the second question, it's answered classically as:

    - inheriting the environment variable for normal programs,

    - using some other configuration information for special programs.

The .GNUsteprc file and the NSUserDefaults database perform this function
for GNUstep programs.

Maybe we should extend .GNUsteprc to support multiple sections for
multiple machines, or perhaps have the option of having .GNUsteprc-host
files which would be used in preference to .GNUsteprc (if the hostname
matches the matchine we are running on).  That would allow the user to
decide if he wants the same gnustep user root and gnustep user defaults on
all machines or to have a different one on some special machine.

If you (/someone) have a more brilliant idea, suggestions are welcome.

The  Workspace Manager  did  store screen  size dependent  preferences
(organization of  the dock for  example) in defaults depending  on the
screen size.  IIRC, WindowMaker does the same too. Similar care should
be  taken by  the  applications,  to handle  default  arrays when  the
default values may  depend on the current running  system. They should
be aware that a home  directory may be shared accros several different
configurations.

But  this, it's  when  GNUstep is  already  launched, initialized  and
already has its GNUSTEP_USER_ROOT.

My point is that the selection of the environment does not necessarily
depend only on the host.  It  may depend on a range of parameters that
we  can  hardly   consider  in  advance  to  put   in  a  hypothetical
'.GNUsteprc'.

As an exemple, my various  .bashrc, .emacs, etc, take into account the
host, the X display, its size, with some hairy conditions.

Yes, the place for information of this nature is in the NSUserDefaults
database.  Only stuff which is needed by the GNUstep-make package
(which can't access the NSUserDefaults database) needs to go in the
.GNUsteprc

Basically, the .GNUsteprc is there to ensure that a few essential bits
of data are consistent between the make package and GNUstep programs.




reply via email to

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