1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: how is envPaths built? |
From: | William Kirstaedter via Tech-talk <tech-talk at aps.anl.gov> |
To: | Marco Filho <marco.filho at ess.eu> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Wed, 28 Aug 2024 15:43:36 +0200 |
Thank you for your email.
you brought me to look at the envPath function in convertRelease.pl as well, and I showed it to my colleague Mike who knows perl very well.
we then discovered that the script just generates the $(IOC) variable from the $(TOP)/iocBoot/iocYOURNAME/ path (in perl its the $cwd variable)
by just removing everything before the last "/". ($ioc =~ s/^.*\///; -> $ioc =~ s/ ^.*\/ / /;)
so, I'll leave my dbLoadDatabase "dbd/test.dbd" hardcoded and not use $(IOC) here.
thanks! :)
William Kirstaedter PP&B Computer Support Group Fritz-Haber-Institut Berlin
For some reason my emails aren't going to tech-talk... Re-sending it here
You kinda got me curious to this too.
I found this script segment which seems to be creating envPaths in epics-base/bin/linux-x86_64/convertRelease.pl:
#
# Generate envPaths file with epicsEnvSet commands for iocsh IOCs.
# Include parentheses anyway in case CEXP users want to use this.
#
sub envPaths {
my @includes = grep !m/^ (RULES | TEMPLATE_TOP) $/x, @apps;
unlink($outfile);
open(OUT,">$outfile") or die "$! creating $outfile";
my $ioc = $cwd;
$ioc =~ s/^.*\///; # iocname is last component of directory name
print OUT "epicsEnvSet(\"IOC\",\"$ioc\")\n";
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
$iocpath =~ s/([\\"])/\\$1/g; # escape back-slashes and double-quotes
print OUT "epicsEnvSet(\"$app\",\"$iocpath\")\n" if (-d $path);
}
close OUT;
}
I don't know perl but it seems it gets the name from the directory and the directory itself is created from another mechanism from makeBaseApp?
I tried changing the directory name and recompiling and it really changes the IOC variable name in envPaths. I'm not sure where is the part of makeBaseApp that creates the directory though.
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of William Kirstaedter via Tech-talk <tech-talk at aps.anl.gov>
Sent: 28 August 2024 10:38
To: tech-talk at aps.anl.gov
Subject: how is envPaths built?Hello,
I'd like to know how the envPaths file in the iocBoot Directory is built.
I tried to load the IOC's main dbd file by using the $(IOC) variable
from envPaths, but noticed that it always will contain an "ioc" Prefix
to the actual IOC name, while the dbd file is called just like the IOC name.
for example, if you create a new empty IOC by using "makeBaseApp.pl -t
ioc test" and "makeBaseApp.pl -i -t ioc test":
you get a Makefile in $(TOP)/testApp/src/ that builds a test.dbd
while in iocBoot, envPaths with always have the $(IOC) variable set to
"ioctest".
Just curious,
--
William Kirstaedter
PP&B Computer Support Group
Fritz-Haber-Institut Berlin
Attachment:
smime.p7s
Description: Kryptografische S/MIME-Signatur