diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm b/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm index 04a08753d55..1abf759ef74 100644 --- a/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm +++ b/Master/tlpkg/tlperl/lib/CPANPLUS/Configure.pm @@ -1,4 +1,5 @@ package CPANPLUS::Configure; +use deprecate; use strict; @@ -20,7 +21,7 @@ local $Params::Check::VERBOSE = 1; ### require, avoid circular use ### require CPANPLUS::Internals; -$VERSION = $CPANPLUS::Internals::VERSION = $CPANPLUS::Internals::VERSION; +$VERSION = "0.9135"; ### can't use O::A as we're using our own AUTOLOAD to get to ### the config options. @@ -523,10 +524,12 @@ sub AUTOLOAD { $type .= '_' if $private; $type .= $field if $field; - unless ( $conf->can($type) ) { + my $type_code = $conf->can($type); + unless ( $type_code ) { error( loc("Invalid method type: '%1'", $name) ); return; } + my $type_obj = $type_code->(); unless( scalar @_ ) { error( loc("No arguments provided!") ); @@ -539,8 +542,8 @@ sub AUTOLOAD { my @list = (); ### get it from the user config first - if( $conf->can($type) and $conf->$type->can($key) ) { - push @list, $conf->$type->$key; + if( my $code = $type_obj->can($key) ) { + push @list, $code->(); ### XXX EU::AI compatibility hack to provide lookups like in ### cpanplus 0.04x; we renamed ->_get_build('base') to @@ -562,8 +565,8 @@ sub AUTOLOAD { while( my($key,$val) = each %args ) { - if( $conf->can($type) and $conf->$type->can($key) ) { - $conf->$type->$key( $val ); + if( my $code = $type_obj->can($key) ) { + $code->( $val ); } else { error( loc(q[No such key '%1' in field '%2'], $key, $type) ); @@ -579,13 +582,13 @@ sub AUTOLOAD { while( my($key,$val) = each %args ) { - if( $conf->$type->can($key) ) { + if( $type_obj->can($key) ) { error( loc( q[Key '%1' already exists for field '%2'], $key, $type)); return; } else { - $conf->$type->mk_accessors( $key ); - $conf->$type->$key( $val ); + $type_obj->mk_accessors( $key ); + $type_obj->$key( $val ); } } return 1; |