projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for .include directive in config files
[openssl.git]
/
util
/
dofile.pl
diff --git
a/util/dofile.pl
b/util/dofile.pl
index e0333fe56851dd3216be84fdf96c6577451c027d..0f2e8f0b53e2ee2c0103943df244ffe1aac6fa6d 100644
(file)
--- a/
util/dofile.pl
+++ b/
util/dofile.pl
@@
-14,6
+14,7
@@
use strict;
use warnings;
use strict;
use warnings;
+use FindBin;
use Getopt::Std;
# We actually expect to get the following hash tables from configdata:
use Getopt::Std;
# We actually expect to get the following hash tables from configdata:
@@
-38,7
+39,7
@@
package OpenSSL::Template;
# a fallback in case it's not installed on the system
use File::Basename;
use File::Spec::Functions;
# a fallback in case it's not installed on the system
use File::Basename;
use File::Spec::Functions;
-use lib
catdir(dirname(__FILE__))
;
+use lib
"$FindBin::Bin/perl"
;
use with_fallback qw(Text::Template);
#use parent qw/Text::Template/;
use with_fallback qw(Text::Template);
#use parent qw/Text::Template/;
@@
-91,7
+92,7
@@
package main;
# Helper functions for the templates #################################
# It might be practical to quotify some strings and have them protected
# Helper functions for the templates #################################
# It might be practical to quotify some strings and have them protected
-# from possible harm. These functions primarly quote things that might
+# from possible harm. These functions primar
i
ly quote things that might
# be interpreted wrongly by a perl eval.
# quotify1 STRING
# be interpreted wrongly by a perl eval.
# quotify1 STRING
@@
-105,7
+106,7
@@
sub quotify1 {
# quotify_l LIST
# For each defined element in LIST (i.e. elements that aren't undef), have
# quotify_l LIST
# For each defined element in LIST (i.e. elements that aren't undef), have
-# it quotified with 'quot
o
fy1'
+# it quotified with 'quot
i
fy1'
sub quotify_l {
map {
if (!defined($_)) {
sub quotify_l {
map {
if (!defined($_)) {
@@
-159,7
+160,11
@@
my @autowarntext = ("WARNING: do not edit!",
my $prev_linecount = 0;
my $text =
@ARGV
my $prev_linecount = 0;
my $text =
@ARGV
- ? join("", map { my $x = "{- output_reset_on() -}".Text::Template::_load_text($_);
+ ? join("", map { my $x = Text::Template::_load_text($_);
+ if (!defined($x)) {
+ die $Text::Template::ERROR, "\n";
+ }
+ $x = "{- output_reset_on() -}" . $x;
my $linecount = $x =~ tr/\n//;
$prev_linecount = ($linecount += $prev_linecount);
$lines{$linecount} = $_;
my $linecount = $x =~ tr/\n//;
$prev_linecount = ($linecount += $prev_linecount);
$lines{$linecount} = $_;
@@
-171,7
+176,10
@@
my $text =
# Load the full template (combination of files) into Text::Template
# and fill it up with our data. Output goes directly to STDOUT
# Load the full template (combination of files) into Text::Template
# and fill it up with our data. Output goes directly to STDOUT
-my $template = OpenSSL::Template->new(TYPE => 'STRING', SOURCE => $text );
+my $template =
+ OpenSSL::Template->new(TYPE => 'STRING',
+ SOURCE => $text,
+ PREPEND => qq{use lib "$FindBin::Bin/perl";});
sub output_reset_on {
$template->output_reset_on();
sub output_reset_on {
$template->output_reset_on();