On Sun, 2008-06-22 at 16:33 +1200, Laszlo (Laca) Peter wrote: > On Fri, 2008-06-20 at 19:19 -0400, Albert Lee wrote: > > There's another problem: > > > > env.sh checks the argument $1 to determine which compiler to use. > > Presumably is this only supposed to work if invoked directly as a > > script, not sourced from a shell. > > > > If I source env.sh from a wrapper script (I use a script to pass pkgtool > > arguments so I only need to specify spec files), $1 is one of the > > arguments for the wrapper script which is not appropriate for env.sh > > > > My current workaround is to wrap the ". /opt/dtbld/bin/env.sh" line > > inside a shell function so $1 is reset. > > How about a separate env-include.sh script that includes everything > env.sh does in the form of a function? > > So in your script, you would have something like: > > . /opt/dtbld/bin/env-include.sh > init_dt_cbe ss12 > > LAca
Delayed evaluation might be useful for more complicated scripts (such as an autobuilder). For the case where env.sh is sourced, the only option for specifying the compiler seems to be an environment variable (it should not be checking $1 in that case). -Albert
