Subject: | Undefined subroutine &CPAN::YACSmoke::msg called |
I thought you might have noticed this, though I saw no reports here yet.
I experienced this error:
Undefined subroutine &CPAN::YACSmoke::msg called at /opt/perl/testers/lib/site_perl/5.8.7/CPAN/YACSmoke.pm line 774.
I tried to peek into the code. Starting from CPANPLUS 0.056_01, in CPANPLUS::Error msg() and error() has been renamed as cp_msg() and cp_error().
I have attached a simple patch with 2 wrappers on msg() and error() seperately. They dispatch the subroutines according to the capability of CPANPLUS::Error. This works for me on both old and newer versions of CPANPLUS. This may not be clean, though. Please tell if there is any problem. Thank you.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
diff -r -u CPAN-YACSmoke-0.03_07.orig/lib/CPAN/YACSmoke.pm CPAN-YACSmoke-0.03_07/lib/CPAN/YACSmoke.pm
- --- CPAN-YACSmoke-0.03_07.orig/lib/CPAN/YACSmoke.pm 2005-06-07 17:57:39.000000000 +0800
+++ CPAN-YACSmoke-0.03_07/lib/CPAN/YACSmoke.pm 2005-12-26 03:19:46.000000000 +0800
@@ -95,7 +95,7 @@
use CPANPLUS::Backend 0.051;
use CPANPLUS::Configure;
- -use CPANPLUS::Error;
+use CPANPLUS::Error qw();
use File::Path;
use File::Basename;
@@ -148,6 +148,23 @@
my %Checked;
my $TiedObj;
+ # Starting from CPANPLUS 0.056_01, msg() and error() were renamed
+ # to cp_msg() and cp_error(). We use two wrappers here.
+ sub msg {
+ if (CPANPLUS::Error->can("msg")) {
+ CPANPLUS::Error::msg(@_)
+ } elsif (CPANPLUS::Error->can("cp_msg")) {
+ CPANPLUS::Error::cp_msg(@_)
+ }
+ }
+ sub error {
+ if (CPANPLUS::Error->can("error")) {
+ CPANPLUS::Error::error(@_)
+ } elsif (CPANPLUS::Error->can("cp_error")) {
+ CPANPLUS::Error::cp_error(@_)
+ }
+ }
+
# We use the TiedObj flag instead of tied(%Checked) because the
# function creates an additional reference in the scope of an
# if (tied %Checked) { ... } which causes a warning etc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDrvDpi9gubzC5S1wRAjstAJ98POtTZ+j21pHe04Edv6Pv+stgoQCgpyfN
Dc32vw1zhikdAjGFZtdKIrw=
=O+hR
-----END PGP SIGNATURE-----