cons-discuss
[Top][All Lists]
Advanced

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

RE: Can we use wildcards to deliver files in Cons?


From: rick . croote
Subject: RE: Can we use wildcards to deliver files in Cons?
Date: Thu, 26 Feb 2004 10:27:31 -0800


As someone else has just said you cannot retrieve that environment variable by running from cons.  You need to run it prior to cons or put the logic in construct or the appropriate Conscript.pl file.  You could have createVersion set the variable and send the value of version to STDOUT to be easily retrieved by Perl.

Example 1: Executing createVersion prior to Cons

> createVersion
> cons.pl

In Conscript.pl:

Command $local_env 'ver' . $ENV{VERS} . '.conf', 'template.txt', 'cat %< > %>';

Example 2: Executing createVersion from Cons

In Conscript.pl:

my $vers = `executeScriptThatSendsVerToStdoutAfterRunningCreateVersion`;
Command $local_env "ver$vers.conf", 'template.txt', 'cat %< > %>';


Rick Croote








"GHOSH, AMIT (HP-ISO STSD-STL)" <address@hidden>

Sent by:
address@hidden

02/26/2004 07:40 AM

       
        To:        "Brad Garcia" <address@hidden>
        cc:        address@hidden
(bcc: Rick Croote/ATL-BTL/MS/PHILIPS)

        Subject:        RE: Can we use wildcards to deliver files in Cons?

        Classification:        




Hi,

I am still not able to figure out how to do this.

The files I have in my module are file1.txt, createVersion and
template.txt.

createVersion is a shell script which generates a version number and
stores it in an environment variable $VER

I have to deliver a file named ver$VER.conf ( the name has to contain
the version number)

My Delivery file is something like this
>cat Delivery

file list:
{
                runtime:
                                 file1.txt
                                 ver*.conf
                                 ;

}
In the above file ver*.conf is a configuration file where the * will
depend on an environment variable. (But I get errors when I try to do
this)

My Conscript contains the below (even this does not work)

Command $local_env 'ver*.conf','template.txt',qq(
                                 createVersion
                                 cat template.txt > ver$VER.conf
                );

Hope the above example makes it clear what I want to do, but don't know
how to do it.

Can anyone who has come across this type of a problem help me?

Regards,
Amit Ghosh

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Brad
Garcia
Sent: Thursday, February 26, 2004 4:43 PM
To: cons mailing list
Subject: Re: Can we use wildcards to deliver files in Cons?


On Thu, 26 Feb 2004, GHOSH, AMIT (HP-ISO STSD-STL) wrote:

> I am facing a problem with Cons. I have a module in which during build

> time a few files are created via shell scripts. Now the problem is
> that the name of the file depends on an environment variable (which
> can change depending on certain conditions), so how do I deliver this
> file in the file list: (Delivery file). I do not know the name of the
> file as it depends on the dynamic environment variable.

Ideally, you would be setting the environment variable from within your
Construct file.  But even if you are not, you can see the value of this
variable from within your Construct file.  So it should be possible to
know the name of the target files within the Construct file.


Brad Garcia


_______________________________________________
address@hidden http://mail.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/


_______________________________________________
address@hidden
http://mail.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/



reply via email to

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