EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Support for shell variables in the EPICS build system
From: Remi Machet <[email protected]>
To: tech-talk <[email protected]>
Cc: "Ernest L. Williams Jr." <[email protected]>
Date: Tue, 09 Dec 2008 09:30:18 -0800
Hi,

I would like to add support for shell variables in convertRelease.pl
(see example patch bellow that is against R3.14.9).

I have been told that this issue was already raised some time ago but
nothing was changed. Looking at the archives I found a post from Ralph
Lange on Tue, 27 May 2003 titled "Re: convertRelease.pl" which makes a
good case against using shell variables.

But in my opinion Ralph makes a case about why some of us should not use
shell variables, not why no one should be able to ... I totally agree
that using shell variables in a production environment can be dangerous
and is in my mind not worth it, but in a development environment it can
be extremely powerful (for example to find out at which version of base
an IOC can work with).

I am sorry if I am re-opening an already closed issue, but I believe
that supporting shell variables, while not for every project could
greatly help some of us.

Remi

--- base/3.14.9/configure/tools/convertRelease.pl	27 Sep 2007 05:49:06 -0000	1.1.1.1
+++ base/3.14.9/configure/tools/convertRelease.pl	13 Nov 2008 02:01:39 -0000
@@ -133,17 +133,22 @@
 	
 	# Expand all already-defined macros in the line:
 	while (my ($pre,$var,$post) = /(.*)\$\((\w+)\)(.*)/) {
-	    last unless (exists $Rmacros->{$var});
-	    $_ = $pre . $Rmacros->{$var} . $post;
-	}
+            if (exists $Rmacros->{$var}) {
+                $_ = $pre . $Rmacros->{$var} . $post;
+            } elsif (exists $ENV{$var}) {
+                $_ = $pre . $ENV{$var} . $post;
+            } else {
+                last
+            }
+        }
 	
 	# Handle "<macro> = <path>"
 	my ($macro, $path) = /^\s*(\w+)\s*=\s*(.*)/;
 	if ($macro ne "") {
-		$macro="TOP" if $macro =~ /^INSTALL_LOCATION/ ;
 		if (exists $Rmacros->{$macro}) {
 			delete $Rmacros->{$macro};
 		} else {
+			push @$Rapps, "TOP" if $macro =~ /^INSTALL_LOCATION/ ;
 			push @$Rapps, $macro;
 		}
 	    $Rmacros->{$macro} = $path;



Replies:
Re: Support for shell variables in the EPICS build system Andrew Johnson

Navigate by Date:
Prev: Re: DeltaTau UMAC ethernet access? Dirk Zimoch
Next: Re: Support for shell variables in the EPICS build system Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: DeltaTau UMAC ethernet access? Dirk Zimoch
Next: Re: Support for shell variables in the EPICS build system Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·