From 3b0f34e0be01830248815330c5c1df2684a899fd Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 6 Dec 2017 16:29:31 -0600 Subject: [PATCH] Fix recursive check in Release.pm --- src/tools/EPICS/Release.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tools/EPICS/Release.pm b/src/tools/EPICS/Release.pm index bceed2ed7..98f18514b 100644 --- a/src/tools/EPICS/Release.pm +++ b/src/tools/EPICS/Release.pm @@ -43,16 +43,16 @@ sub readReleaseFiles { # Parse a configure/RELEASE* file and anything it includes # sub readRelease { - my ($file, $Rmacros, $Rapps, $Rdone) = @_; - # $Rmacros and $Rdone are hash-refs, $Rapps an array-ref + my ($file, $Rmacros, $Rapps, $Ractive) = @_; + # $Rmacros and $Ractive are hash-refs, $Rapps an array-ref - if (exists $Rdone->{$file}) { + if ($Ractive->{$file} > 0) { 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}++; + $Ractive->{$file}++; while (<$IN>) { chomp; s/ \r $//x; # Shouldn't need this, but sometimes... @@ -77,11 +77,12 @@ sub readRelease { my ($op, $path) = m/^ \s* (-? include) \s+ (.*)/x; $path = expandMacros($path, $Rmacros); if (-e $path) { - &readRelease($path, $Rmacros, $Rapps, $Rdone); + &readRelease($path, $Rmacros, $Rapps, $Ractive); } elsif ($op eq "include") { carp "EPICS/Release.pm: Include file '$path' not found\n"; } } + $Ractive->{$file}--; close $IN; }