From 2d0d914485d1c26d2b3e98e570378eddd6f44cc6 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 21 Feb 2018 18:37:11 -0600 Subject: [PATCH] Create a ModuleDirs file & adjust template scripts to use it --- src/template/top/caPerlApp/Makefile | 2 ++ src/template/top/caPerlApp/caget.pl | 5 ++++- src/template/top/caPerlApp/cainfo.pl | 5 ++++- src/template/top/caPerlApp/camonitor.pl | 5 ++++- src/template/top/caPerlApp/caput.pl | 5 ++++- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/template/top/caPerlApp/Makefile b/src/template/top/caPerlApp/Makefile index 57de9ae58..34439cbfd 100644 --- a/src/template/top/caPerlApp/Makefile +++ b/src/template/top/caPerlApp/Makefile @@ -4,6 +4,8 @@ include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +PERL_SCRIPTS += _APPNAME_ModuleDirs.pm + PERL_SCRIPTS += cainfo.pl PERL_SCRIPTS += caput.pl PERL_SCRIPTS += caget.pl diff --git a/src/template/top/caPerlApp/caget.pl b/src/template/top/caPerlApp/caget.pl index 9d3df35b4..5e7be9f79 100644 --- a/src/template/top/caPerlApp/caget.pl +++ b/src/template/top/caPerlApp/caget.pl @@ -2,8 +2,11 @@ use strict; +# This construct sets @INC to search lib/perl of all RELEASE entries use FindBin qw($Bin); -use lib "$Bin/../../lib/perl"; +use lib ($Bin, "$Bin/../../lib/perl"); +use _APPNAME_ModuleDirs; +no lib $Bin; use Getopt::Std; use Scalar::Util qw(looks_like_number); diff --git a/src/template/top/caPerlApp/cainfo.pl b/src/template/top/caPerlApp/cainfo.pl index ee6b6d0a2..3e38e8baf 100644 --- a/src/template/top/caPerlApp/cainfo.pl +++ b/src/template/top/caPerlApp/cainfo.pl @@ -2,8 +2,11 @@ use strict; +# This construct sets @INC to search lib/perl of all RELEASE entries use FindBin qw($Bin); -use lib "$Bin/../../lib/perl"; +use lib ($Bin, "$Bin/../../lib/perl"); +use _APPNAME_ModuleDirs; +no lib $Bin; use Getopt::Std; use CA; diff --git a/src/template/top/caPerlApp/camonitor.pl b/src/template/top/caPerlApp/camonitor.pl index d49c85d45..564688d68 100644 --- a/src/template/top/caPerlApp/camonitor.pl +++ b/src/template/top/caPerlApp/camonitor.pl @@ -2,8 +2,11 @@ use strict; +# This construct sets @INC to search lib/perl of all RELEASE entries use FindBin qw($Bin); -use lib "$Bin/../../lib/perl"; +use lib ($Bin, "$Bin/../../lib/perl"); +use _APPNAME_ModuleDirs; +no lib $Bin; use Getopt::Std; use Scalar::Util qw(looks_like_number); diff --git a/src/template/top/caPerlApp/caput.pl b/src/template/top/caPerlApp/caput.pl index 468c3ad7a..64ff9cbda 100644 --- a/src/template/top/caPerlApp/caput.pl +++ b/src/template/top/caPerlApp/caput.pl @@ -2,8 +2,11 @@ use strict; +# This construct sets @INC to search lib/perl of all RELEASE entries use FindBin qw($Bin); -use lib "$Bin/../../lib/perl"; +use lib ($Bin, "$Bin/../../lib/perl"); +use _APPNAME_ModuleDirs; +no lib $Bin; use Getopt::Std; use CA;