Merge 3.16 into 3.17
This commit is contained in:
@@ -97,6 +97,7 @@ TESTFILES += $(COMMON_DIR)/analogMonitorTest.dbd ../analogMonitorTest.db
|
||||
TESTS += analogMonitorTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/regressTest.dbd
|
||||
DBDDEPENDS_FILES += regressTest.dbd$(DEP)
|
||||
regressTest_DBD += base.dbd
|
||||
TESTPROD_HOST += regressTest
|
||||
regressTest_SRCS += regressTest.c
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
use Carp;
|
||||
|
||||
# Copy directories and files from a template
|
||||
|
||||
sub copyTree {
|
||||
@@ -15,7 +13,7 @@ sub copyTree {
|
||||
# $Rtextsubs contains substitutions for file content.
|
||||
|
||||
opendir my $FILES, $src
|
||||
or croak "opendir failed while copying $src: $!\n";
|
||||
or die "opendir failed while copying $src: $!\n";
|
||||
my @entries = readdir $FILES;
|
||||
closedir $FILES;
|
||||
|
||||
@@ -36,9 +34,9 @@ sub copyTree {
|
||||
print "." unless $opt_d;
|
||||
copyFile($srcName, $dstName, $Rtextsubs);
|
||||
} elsif (-l $srcName) {
|
||||
carp "\nSoft link in template, ignored:\n\t$srcName\n";
|
||||
warn "\nSoft link in template, ignored:\n\t$srcName\n";
|
||||
} else {
|
||||
carp "\nUnknown file type in template, ignored:\n\t$srcName\n";
|
||||
warn "\nUnknown file type in template, ignored:\n\t$srcName\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,11 +44,11 @@ sub copyTree {
|
||||
sub copyDir {
|
||||
my ($src, $dst, $Rnamesubs, $Rtextsubs) = @_;
|
||||
if (-e $dst && ! -d $dst) {
|
||||
carp "\nTarget exists but is not a directory, skipping:\n\t$dst\n";
|
||||
warn "\nTarget exists but is not a directory, skipping:\n\t$dst\n";
|
||||
return;
|
||||
}
|
||||
print "Creating directory '$dst'\n" if $opt_d;
|
||||
mkdir $dst, 0777 or croak "Can't create $dst: $!\n"
|
||||
mkdir $dst, 0777 or die "Can't create $dst: $!\n"
|
||||
unless -d $dst;
|
||||
copyTree($src, $dst, $Rnamesubs, $Rtextsubs);
|
||||
}
|
||||
@@ -61,7 +59,7 @@ sub copyFile {
|
||||
print "Creating file '$dst'\n" if $opt_d;
|
||||
open(my $SRC, '<', $src)
|
||||
and open(my $DST, '>', $dst)
|
||||
or croak "$! copying $src to $dst\n";
|
||||
or die "$! copying $src to $dst\n";
|
||||
while (<$SRC>) {
|
||||
# Substitute any @VARS@ in the text
|
||||
s{@(\w+?)@}
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
use Carp;
|
||||
|
||||
#
|
||||
# Parse all relevent configure/RELEASE* files and includes
|
||||
#
|
||||
@@ -51,7 +49,7 @@ sub readRelease {
|
||||
"discovered in $file\n";
|
||||
}
|
||||
|
||||
open(my $IN, '<', $file) or croak "Can't open $file: $!\n";
|
||||
open(my $IN, '<', $file) or die "Can't open $file: $!\n";
|
||||
$Ractive->{$file}++;
|
||||
while (<$IN>) {
|
||||
chomp;
|
||||
@@ -79,7 +77,7 @@ sub readRelease {
|
||||
if (-e $path) {
|
||||
&readRelease($path, $Rmacros, $Rapps, $Ractive);
|
||||
} elsif ($op eq "include") {
|
||||
carp "EPICS/Release.pm: Include file '$path' not found\n";
|
||||
warn "EPICS/Release.pm: Include file '$path' not found\n";
|
||||
}
|
||||
}
|
||||
$Ractive->{$file}--;
|
||||
@@ -101,17 +99,18 @@ sub expandMacros {
|
||||
}
|
||||
|
||||
#
|
||||
# Expand all (possibly nested) macros in dictionary
|
||||
# Expand all (possibly nested) macros in a dictionary
|
||||
#
|
||||
sub expandRelease {
|
||||
my ($Rmacros) = @_;
|
||||
my ($Rmacros, $warn) = @_;
|
||||
# $Rmacros is a reference to a hash
|
||||
$warn = '' unless defined $warn;
|
||||
|
||||
while (my ($macro, $val) = each %$Rmacros) {
|
||||
while (my ($pre,$var,$post) = $val =~ m/ (.*) \$\( (\w+) \) (.*) /x) {
|
||||
carp "EPICS/Release.pm: Undefined macro \$($var) used\n"
|
||||
warn "EPICS/Release.pm: Undefined macro \$($var) used $warn\n"
|
||||
unless exists $Rmacros->{$var};
|
||||
croak "EPICS/Release.pm: Circular definition of macro $macro\n"
|
||||
die "EPICS/Release.pm: Circular definition of macro $var $warn\n"
|
||||
if $macro eq $var;
|
||||
$val = $pre . $Rmacros->{$var} . $post;
|
||||
$Rmacros->{$macro} = $val;
|
||||
|
||||
@@ -222,7 +222,7 @@ sub checkRelease {
|
||||
my @order = ();
|
||||
my $relfile = "$path/configure/RELEASE";
|
||||
readReleaseFiles($relfile, \%check, \@order, $arch);
|
||||
expandRelease(\%check);
|
||||
expandRelease(\%check, "while checking module\n\t$app = $path");
|
||||
delete $check{TOP};
|
||||
delete $check{EPICS_HOST_ARCH};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user