Le samedi 19 janvier 2002, � 02:13 PM, Sylvain Cuaz a �crit :

>> Le vendredi 11 janvier 2002, � 04:05 PM, Max Horn a �crit :
>>
>> At 9:07 Uhr -0500 11.01.2002, Bill Bumgarner wrote:
>>> xerces-j depends on ant... as it should.
>>>
>>> ant sets JAVA_HOME in profile.d... as it should.
>>>
>>> The problem is that if you do 'fink install xerces-j' from a totally 
>>> clean system, fink will build ant, then try to build xerces-j, but 
>>> fail because the JAVA_HOME environment variable hasn't been set. The 
>>> shell needs to be reinitialized.
>>>
>>> Likely, Fink should source init.csh before each build to ensure that 
>>> any shell variables from the previous package are installed.
>>
>> Hm, maybe.
>>
>> But then we also need to change the init.(c)sh scripts to handle this 
>> case correctly. Right now, if you source them twice, you will get all 
>> paths twice.
>
>       yes, we need to solve this


        I've come up with a solution (a bit inspired by a mail by David 
about "mulitple loads of init.(c)sh" ;-) .

First add this at the end (this will tell us  if we already go through) :

if ( $?FINKINIT) then
else
   setenv FINKINIT
endif


Then, I think there are 2 kind of environment variables :
                1) those that can not be modified (for example PATH MANPATH, 
if you don't (can't) install create some symlinks), and thus require to 
go through only once. Add this around :

if ( $?FINKINIT ) then
else
        ...
endif

                2) those that can be modified (for example CLASSPATH),  add 
this before :

if ( $?FINKINIT ) then
     #already pass at least  1
     #restore the user environment variable
     if ( $?USER_CLASSPATH ) then
         setenv CLASSPATH $USER_CLASSPATH
     else
         unsetenv CLASSPATH
     endif
else
     #1st time
     #record the user environment variable
     if ( $?CLASSPATH ) then
       setenv USER_CLASSPATH $CLASSPATH
     endif
endif


        Did I forgot something ?
        Yes I know it's a little lengthy ;-)


--
Zauc


_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to