From ae75faa19c220b1a8a42cfa00dbdc1486806e4d4 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 8 Jul 1999 14:57:15 +0000 Subject: [PATCH] cd top; look at all definitions in config/RELEASE --- .../top/config/makeIocCdCommands.pl | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/makeBaseApp/top/config/makeIocCdCommands.pl b/src/makeBaseApp/top/config/makeIocCdCommands.pl index c8d74dd92..0c1962f02 100644 --- a/src/makeBaseApp/top/config/makeIocCdCommands.pl +++ b/src/makeBaseApp/top/config/makeIocCdCommands.pl @@ -11,23 +11,50 @@ $arch = $ARGV[0]; unlink("cdCommands"); open(OUT,">cdCommands") or die "$! opening cdCommands"; print OUT "startup = \"$cwd\"\n"; + +#appbin is kept for compatibility with 3.13.1 $appbin = $cwd; $appbin =~ s/iocBoot.*//; $appbin = $appbin . "/bin/${arch}"; print OUT "appbin = \"$appbin\"\n"; -#look for SHARE in /config/RELEASE -$release = $cwd; -$release =~ s/iocBoot.*//; -$release = $release . "config/RELEASE"; + +$top = $cwd; +$top =~ s/\/iocBoot.*//; +print OUT "top = \"$top\"\n"; +$topbin = "${top}/bin/${arch}"; +#skip check that top/bin/${arch} exists; src may not have been builT +print OUT "topbin = \"$topbin\"\n"; +$release = "$top/config/RELEASE"; if (-r "$release") { open(IN, "$release") or die "Cannot open $release\n"; - while () { - chomp; - s/^SHARE\s*=\s*// and $share = $_, break; + while ($line = ) { + next if ( $line =~ /\s*#/ ); + chomp($line); + $_ = $line; + #the following looks for + # prefix = $(macro)post + ($prefix,$macro,$post) = /(.*)\s*=\s*\$\((.*)\)(.*)/; + if ($macro eq "") { # true if no macro is present + # the following looks for + # prefix = post + ($prefix,$post) = /(.*)\s*=\s*(.*)/; + } else { + $base = $applications{$macro}; + if ($base eq "") { + print "error: $macro was not previously defined\n"; + } else { + $post = $base . $post; + } + } + $applications{$prefix} = $post; + $app = lc($prefix); + if ( -d "$post") { #check that directory exists + print OUT "$app = \"$post\"\n"; + } + if ( -d "$post/bin/$arch") { #check that directory exists + print OUT "${app}bin = \"$post/bin/$arch\"\n"; + } } close IN; } -if ( "$share" ) { - print OUT "share = \"$share\"\n"; -} close OUT;