Merged changes from 3.15 branch into 3.16

This commit is contained in:
Andrew Johnson
2017-06-22 19:00:51 -05:00
3 changed files with 27 additions and 12 deletions
+1 -1
View File
@@ -348,7 +348,7 @@ testspec: $(TESTSCRIPTS)
test-results: tapfiles
ifneq ($(TAPFILES),)
ifdef RUNTESTS_ENABLED
prove --failures --ext .tap --exec cat --color $(TAPFILES)
prove --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES)
endif
endif
+10 -3
View File
@@ -33,9 +33,16 @@ ok(msi('-S../t6-substitute.txt ../t6-template.txt'), slurp('../t6-result.txt'));
# Output option -o
my $out = 't7-output.txt';
unlink $out;
msi("-I.. -o $out ../t1-template.txt");
ok(slurp($out), slurp('../t1-result.txt'));
my $count = 5; # Try up to 5 times...
my $result;
do {
unlink $out;
msi("-I.. -o $out ../t1-template.txt");
$result = slurp($out);
print "# msi output file empty, retrying\n"
if $result eq '';
} while ($result eq '') && (--$count > 0);
ok($result, slurp('../t1-result.txt'));
# Dependency generation, include/substitute model
ok(msi('-I.. -D -o t8.txt ../t1-template.txt'), slurp('../t8-result.txt'));
+16 -8
View File
@@ -17,22 +17,24 @@ sub readReleaseFiles {
$Rmacros->{'EPICS_HOST_ARCH'} = $hostarch if $hostarch;
return unless (-e $relfile);
readRelease($relfile, $Rmacros, $Rapps);
my %done;
&readRelease($relfile, $Rmacros, $Rapps, \%done);
if ($hostarch) {
my $hrelfile = "$relfile.$hostarch";
readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile);
&readRelease($hrelfile, $Rmacros, $Rapps, \%done) if (-e $hrelfile);
$hrelfile .= '.Common';
readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile);
&readRelease($hrelfile, $Rmacros, $Rapps, \%done) if (-e $hrelfile);
}
if ($arch) {
my $crelfile = "$relfile.Common.$arch";
readRelease($crelfile, $Rmacros, $Rapps) if (-e $crelfile);
&readRelease($crelfile, $Rmacros, $Rapps, \%done) if (-e $crelfile);
if ($hostarch) {
my $arelfile = "$relfile.$hostarch.$arch";
readRelease($arelfile, $Rmacros, $Rapps) if (-e $arelfile);
&readRelease($arelfile, $Rmacros, $Rapps, \%done) if (-e $arelfile);
}
}
}
@@ -41,10 +43,16 @@ sub readReleaseFiles {
# Parse a configure/RELEASE* file and anything it includes
#
sub readRelease {
my ($file, $Rmacros, $Rapps) = @_;
# $Rmacros is a reference to a hash, $Rapps a ref to an array
my ($file, $Rmacros, $Rapps, $Rdone) = @_;
# $Rmacros and $Rdone are hash-refs, $Rapps an array-ref
if (exists $Rdone->{$file}) {
die "Release.pm: Recursive loop found in RELEASE files,\n" .
"discovered in $file\n";
}
open(my $IN, '<', $file) or croak "Can't open $file: $!\n";
$Rdone->{$file}++;
while (<$IN>) {
chomp;
s/ \r $//x; # Shouldn't need this, but sometimes...
@@ -69,7 +77,7 @@ sub readRelease {
my ($op, $path) = m/^ \s* (-? include) \s+ (.*)/x;
$path = expandMacros($path, $Rmacros);
if (-e $path) {
readRelease($path, $Rmacros, $Rapps);
&readRelease($path, $Rmacros, $Rapps, $Rdone);
} elsif ($op eq "include") {
carp "EPICS/Release.pm: Include file '$path' not found\n";
}