behaviour of <variable>

Vassili Dzuba vassilidzuba at nerim.net
Sat Aug 17 01:59:34 PDT 2002


I had a deeper look at <variable>, and it seems that the behaviour is
not what i thought previously.

<variable> maps directely to a setenv() call, and therefore the declaration
of an environment variable is not local to the stage in which it occurs

For instance:

  <!DOCTYPE alfs SYSTEM "alfs.dtd">
  <alfs version="3.0">

     <stage name="stage 1">
         <stageinfo>
             <environment>
	        <variable name="FOO">BAR</variable>
             </environment>
	 </stageinfo>
	 <execute command="echo">
	     <param>FOO is $FOO</param>
         </execute>
     </stage>

    <stage name="stage 2">
	 <execute command="echo">
	     <param>FOO is $FOO</param>
         </execute>
    </stage>

  </alfs>

will display, when executed under nALFS :

xI: Executing /var2/ALFS/profiles/BLFS/test.xml...                             x
xI:                                                                            x
xI: Setting environment variable FOO:                                          x
xI:     BAR                                                                    x
xI: Executing system command in /:                                             x
xI:     echo FOO is $FOO                                                       x
x-: FOO is BAR                                                                 x
xI: Executing system command in /:                                             x
xI:     echo FOO is $FOO                                                       x
x-: FOO is BAR                                                                 x
xI: Execution successfully done.                                               x
xI: Total time executing: 00:00:00                                             x

The value of FOO is still BAR when being in stage2.

I don't know if it is a bug or the intended behaviour.


Vassili Dzuba
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list