RE: Can we use wildcards to deliver files in Cons?
[email protected] Thu, 26 Feb 2004 10:27:31 -0800
| Newsgroups | gmane.comp.gnu.cons.general |
|---|---|
| Message-ID | <OF6CF3D09E.CA521801-ON86256E46.005EADEC-88256E46.0065164A@diamond.philips.com> |
This is a multipart message in MIME format.
--===============1723645024==
Content-Type: multipart/alternative;
boundary="=_alternative 0065162F88256E46_="
This is a multipart message in MIME format.
--=_alternative 0065162F88256E46_=
Content-Type: text/plain; charset="us-ascii"
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)" <[email protected]>
Sent by:
[email protected]
02/26/2004 07:40 AM
To: "Brad Garcia" <[email protected]>
cc: [email protected]
(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: [email protected]
[mailto:[email protected]] 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
_______________________________________________
[email protected] http://mail.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/
_______________________________________________
[email protected]
http://mail.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/
--=_alternative 0065162F88256E46_=
Content-Type: text/html; charset="us-ascii"
<br><font size=2 face="sans-serif">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.</font>
<br>
<br><font size=2 face="sans-serif">Example 1: Executing createVersion prior to Cons</font>
<br>
<br><font size=2 face="sans-serif">> createVersion</font>
<br><font size=2 face="sans-serif">> cons.pl</font>
<br>
<br><font size=2 face="sans-serif">In Conscript.pl:</font>
<br>
<br><font size=2 face="sans-serif">Command $local_env 'ver' . $ENV{VERS} . '.conf', 'template.txt', 'cat %< > %>';</font>
<br>
<br><font size=2 face="sans-serif">Example 2: Executing createVersion from Cons</font>
<br>
<br><font size=2 face="sans-serif">In Conscript.pl:</font>
<br>
<br><font size=2 face="sans-serif">my $vers = `executeScriptThatSendsVerToStdoutAfterRunningCreateVersion`;</font>
<br><font size=2 face="sans-serif">Command $local_env "ver$vers.conf", 'template.txt', 'cat %< > %>';</font>
<br>
<br>
<br><font size=2 face="sans-serif">Rick Croote</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td>
<br>
<br>
<br>
<br>
<br><font size=1 face="sans-serif"><b>"GHOSH, AMIT (HP-ISO STSD-STL)" <[email protected]></b></font>
<p><font size=1 face="sans-serif">Sent by: </font>
<br><font size=1 face="sans-serif">[email protected]</font>
<p><font size=1 face="sans-serif">02/26/2004 07:40 AM</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: "Brad Garcia" <[email protected]></font>
<br><font size=1 face="sans-serif"> cc: [email protected]<br>
(bcc: Rick Croote/ATL-BTL/MS/PHILIPS)</font>
<br><font size=1 face="sans-serif"> Subject: RE: Can we use wildcards to deliver files in Cons?</font>
<p><font size=1 face="sans-serif"> Classification: </font>
<br></table>
<br>
<br>
<br><font size=2 face="Courier New">Hi,<br>
<br>
I am still not able to figure out how to do this.<br>
<br>
The files I have in my module are file1.txt, createVersion and<br>
template.txt.<br>
<br>
createVersion is a shell script which generates a version number and<br>
stores it in an environment variable $VER<br>
<br>
I have to deliver a file named ver$VER.conf ( the name has to contain<br>
the version number)<br>
<br>
My Delivery file is something like this<br>
>cat Delivery<br>
<br>
file list:<br>
{<br>
runtime:<br>
file1.txt<br>
ver*.conf<br>
;<br>
<br>
}<br>
In the above file ver*.conf is a configuration file where the * will<br>
depend on an environment variable. (But I get errors when I try to do<br>
this)<br>
<br>
My Conscript contains the below (even this does not work)<br>
<br>
Command $local_env 'ver*.conf','template.txt',qq(<br>
createVersion<br>
cat template.txt > ver$VER.conf<br>
);<br>
<br>
Hope the above example makes it clear what I want to do, but don't know<br>
how to do it.<br>
<br>
Can anyone who has come across this type of a problem help me?<br>
<br>
Regards,<br>
Amit Ghosh<br>
<br>
-----Original Message-----<br>
From: [email protected]<br>
[mailto:[email protected]] On Behalf Of Brad<br>
Garcia<br>
Sent: Thursday, February 26, 2004 4:43 PM<br>
To: cons mailing list<br>
Subject: Re: Can we use wildcards to deliver files in Cons?<br>
<br>
<br>
On Thu, 26 Feb 2004, GHOSH, AMIT (HP-ISO STSD-STL) wrote:<br>
<br>
> I am facing a problem with Cons. I have a module in which during build<br>
<br>
> time a few files are created via shell scripts. Now the problem is <br>
> that the name of the file depends on an environment variable (which <br>
> can change depending on certain conditions), so how do I deliver this <br>
> file in the file list: (Delivery file). I do not know the name of the <br>
> file as it depends on the dynamic environment variable.<br>
<br>
Ideally, you would be setting the environment variable from within your<br>
Construct file. But even if you are not, you can see the value of this<br>
variable from within your Construct file. So it should be possible to<br>
know the name of the target files within the Construct file.<br>
<br>
<br>
Brad Garcia<br>
<br>
<br>
_______________________________________________<br>
[email protected] http://mail.gnu.org/mailman/listinfo/cons-discuss<br>
Cons URL: http://www.dsmit.com/cons/<br>
<br>
<br>
_______________________________________________<br>
[email protected]<br>
http://mail.gnu.org/mailman/listinfo/cons-discuss<br>
Cons URL: http://www.dsmit.com/cons/<br>
</font>
<br>
<br>
--=_alternative 0065162F88256E46_=--
--===============1723645024==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
[email protected]
http://mail.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/
--===============1723645024==--