From f02884d9968b473a5fd6d340f25376ff947f8eda Mon Sep 17 00:00:00 2001 From: Hugo Slepicka Date: Thu, 29 Apr 2021 17:11:36 -0700 Subject: [PATCH] Add error message for when EPICS_BASE is not set on templates. Add error message and validation at convertRelease.pl for empty RELEASE files. --- src/template/base/top/configure/CONFIG | 5 +++++ src/template/ext/top/configure/CONFIG | 5 +++++ src/tools/convertRelease.pl | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/template/base/top/configure/CONFIG b/src/template/base/top/configure/CONFIG index c1a470322..7dfd05d5b 100644 --- a/src/template/base/top/configure/CONFIG +++ b/src/template/base/top/configure/CONFIG @@ -13,6 +13,11 @@ ifdef T_A -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif +# Check for proper EPICS_BASE +ifneq (file,$(origin EPICS_BASE)) + $(error EPICS_BASE must be defined in configure/RELEASE or a similar file or it will not be correctly read by convertRelease.pl!) +endif + CONFIG = $(RULES)/configure include $(CONFIG)/CONFIG diff --git a/src/template/ext/top/configure/CONFIG b/src/template/ext/top/configure/CONFIG index 321f6cea2..de0742729 100644 --- a/src/template/ext/top/configure/CONFIG +++ b/src/template/ext/top/configure/CONFIG @@ -17,6 +17,11 @@ ifdef T_A -include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) endif +# Check for proper EPICS_BASE +ifneq (file,$(origin EPICS_BASE)) + $(error EPICS_BASE must be defined in configure/RELEASE or a similar file or it will not be correctly read by convertRelease.pl!) +endif + CONFIG = $(RULES)/configure include $(CONFIG)/CONFIG diff --git a/src/tools/convertRelease.pl b/src/tools/convertRelease.pl index 3375eb4f2..d2fa2dc87 100644 --- a/src/tools/convertRelease.pl +++ b/src/tools/convertRelease.pl @@ -113,6 +113,9 @@ EOF # sub releaseTops { my @includes = grep !m/^ (TOP | TEMPLATE_TOP) $/x, @apps; + if (!@includes) { + die "No variables defined in RELEASE*s"; + } print join(' ', @includes), "\n"; } @@ -256,6 +259,9 @@ sub checkRelease { } my @modules = grep(!m/^(RULES|TOP|TEMPLATE_TOP)$/, @apps); + if (!@modules) { + die "No variables defined in RELEASE*s"; + } my $app = shift @modules; my $latest = AbsPath($macros{$app}); my %paths = ($latest => $app);