Element: <environment>

Syntax

<!ELEMENT environment    (variable+)>
<!ATTLIST environment
          mode           (append | prepend) #IMPLIED>

This element occurs in : Element: <stageinfo>

See also : Element: <variable>

Description

The environment element allows you to define one or more environment variables to be added to the system environment used when calling the commands of the stage to which it applies.

By default, the supplied value replaces any existing value for the specified variable. The mode attribute allows you to specify whether the supplied value should be prepended or appended to the existing value.

Examples

<stage>
        <stageinfo>

                <base>/usr/src/gzip.1.2.4a</base>

                <environment>
                        <variable name="GCCFLAGS">-O2</variable>
                        <variable name="PATH" mode="prepend">/usr/src/gzip.1.2.4a:</variable>
                        <variable name="LDFLAGS" mode="append"> -s</variable>
                </environment>

        </stageinfo>

</stage>

The equivalent bash script is :

echo Stage

export GCCFLAGS=-O2
export PATH=/usr/src/gzip.1.2.4a:$PATH
export LDFLAGS="$LDFLAGS -s"

echo Exiting stage