summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/CPAN.pm
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2022-03-14 10:08:50 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2022-03-14 10:08:50 +0000
commit49b9d8ffc05bf0c271287eb1390cabad28c6a47a (patch)
treee2e1779b1d4795d6b2c3bf92a4e2e4154d82124b /Master/tlpkg/tlperl/lib/CPAN.pm
parentf03a75ebd3b935ecde4dde32687fbe86161c30ed (diff)
New tlperl 5.34
git-svn-id: svn://tug.org/texlive/trunk@62701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/CPAN.pm23
1 files changed, 13 insertions, 10 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN.pm b/Master/tlpkg/tlperl/lib/CPAN.pm
index 2d87f47f8b9..c93d98e8db2 100644
--- a/Master/tlpkg/tlperl/lib/CPAN.pm
+++ b/Master/tlpkg/tlperl/lib/CPAN.pm
@@ -2,7 +2,7 @@
# vim: ts=4 sts=4 sw=4:
use strict;
package CPAN;
-$CPAN::VERSION = '2.27';
+$CPAN::VERSION = '2.28';
$CPAN::VERSION =~ s/_//;
# we need to run chdir all over and we would get at wrong libraries
@@ -558,7 +558,9 @@ sub _yaml_loadfile {
# 5.6.2 could not do the local() with the reference
# so we do it manually instead
my $old_loadcode = ${"$yaml_module\::LoadCode"};
+ my $old_loadblessed = ${"$yaml_module\::LoadBlessed"};
${ "$yaml_module\::LoadCode" } = $CPAN::Config->{yaml_load_code} || 0;
+ ${ "$yaml_module\::LoadBlessed" } = 1;
my ($code, @yaml);
if ($code = UNIVERSAL::can($yaml_module, "LoadFile")) {
@@ -569,19 +571,20 @@ sub _yaml_loadfile {
}
} elsif ($code = UNIVERSAL::can($yaml_module, "Load")) {
local *FH;
- unless (open FH, $local_file) {
+ if (open FH, $local_file) {
+ local $/;
+ my $ystream = <FH>;
+ eval { @yaml = $code->($ystream); };
+ if ($@) {
+ # this shall not be done by the frontend
+ die CPAN::Exception::yaml_process_error->new($yaml_module,$local_file,"parse",$@);
+ }
+ } else {
$CPAN::Frontend->mywarn("Could not open '$local_file': $!");
- return +[];
- }
- local $/;
- my $ystream = <FH>;
- eval { @yaml = $code->($ystream); };
- if ($@) {
- # this shall not be done by the frontend
- die CPAN::Exception::yaml_process_error->new($yaml_module,$local_file,"parse",$@);
}
}
${"$yaml_module\::LoadCode"} = $old_loadcode;
+ ${"$yaml_module\::LoadBlessed"} = $old_loadblessed;
return \@yaml;
} else {
# this shall not be done by the frontend