From 1935a5861c7e4bc1e0a4434800896a2dbd834ae4 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Mon, 9 Sep 2019 11:51:01 +0200 Subject: Rework the perl fallback functionality The module with_fallback.pm was kind of clunky and required a transfer module. This change replaces if with a much more generic pragma type module, which simply appends given directories to @INC (as opposed to the 'lib' pragma, which prepends the directories to @INC). This also supports having a file MODULES.txt with sub-directories to modules. This ensures that we don't have to spray individual module paths throughout our perl code, but can have them collected in one place. (do note that there is a 'fallback' module on CPAN. However, it isn't part of the core perl, and it has no support the any MODULES.txt kind of construct) Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/9826) --- external/perl/MODULES.txt | 1 + external/perl/transfer/Text/Template.pm | 23 ----------------------- 2 files changed, 1 insertion(+), 23 deletions(-) create mode 100644 external/perl/MODULES.txt delete mode 100644 external/perl/transfer/Text/Template.pm (limited to 'external') diff --git a/external/perl/MODULES.txt b/external/perl/MODULES.txt new file mode 100644 index 0000000000..442b618f0c --- /dev/null +++ b/external/perl/MODULES.txt @@ -0,0 +1 @@ +Text-Template-1.46/lib diff --git a/external/perl/transfer/Text/Template.pm b/external/perl/transfer/Text/Template.pm deleted file mode 100644 index dbe6d737ed..0000000000 --- a/external/perl/transfer/Text/Template.pm +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. -# -# Licensed under the Apache License 2.0 (the "License"). You may not use -# this file except in compliance with the License. You can obtain a copy -# in the file LICENSE in the source distribution or at -# https://www.openssl.org/source/license.html - -# Quick transfer to the downloaded Text::Template - -package transfer::Text::Template; -$VERSION = 1.46; - -BEGIN { - use File::Spec::Functions; - use File::Basename; - use lib catdir(dirname(__FILE__), "..", "..", "Text-Template-1.46", "lib"); - # Some unpackers on VMS convert periods in directory names to underscores - use lib catdir(dirname(__FILE__), "..", "..", "Text-Template-1_46", "lib"); - use Text::Template; - shift @INC; # Takes away the effect of use lib - shift @INC; # Takes away the effect of use lib -} -1; -- cgit v1.2.3