summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-09-09 11:51:01 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-12 12:49:31 +0200
commit1935a5861c7e4bc1e0a4434800896a2dbd834ae4 (patch)
tree6419cf2764c32889996d4c20f276c21e5f4b815e /external
parent7eeceeaab24aea16027cdc1f9df92366094893b7 (diff)
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 <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9826)
Diffstat (limited to 'external')
-rw-r--r--external/perl/MODULES.txt1
-rw-r--r--external/perl/transfer/Text/Template.pm23
2 files changed, 1 insertions, 23 deletions
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;