New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backwards compat issue with File::Copy #9138
Comments
From @jdvCreated by @jdvFile::Copy::copy() checks whether its two args are equal. Newer --- ./perl-5.10.0-RC2/lib/File/Copy.pm 2007-11-25 13:09:07.000000000 The test case I used was this: Thanks, Perl Info
|
From @rgsOn 03/12/2007, via RT Justin DeVuyst <perlbug-followup@perl.org> wrote:
reftype() might be a bit overkill here. I think we want use ref address
return $_[0] eq $_[1]; This way, objects with overloaded stringification will work.
|
The RT System itself - Status changed from 'new' to 'open' |
From @jdvRafael Garcia-Suarez via RT wrote:
That sounds much more sane. I did my patch hastily and realized
|
From @jdvHow about this? Inline Patchdiff -ru lib/File/Copy.pm lib2/File/Copy.pm
--- lib/File/Copy.pm 2007-12-10 04:53:02.000000000 -0500
+++ lib2/File/Copy.pm 2007-12-10 04:12:33.000000000 -0500
@@ -12,6 +12,7 @@
use warnings;
use File::Spec;
use Config;
+use Scalar::Util qw( blessed refaddr );
our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy);
sub copy;
sub syscopy;
@@ -67,9 +68,9 @@
# _eq($from, $to) tells whether $from and $to are identical
# works for strings and references
sub _eq {
- return $_[0] == $_[1] if ref $_[0] && ref $_[1];
- return $_[0] eq $_[1] if !ref $_[0] && !ref $_[1];
- return "";
+ return refaddr $_[0] == refaddr $_[1]
+ if ref $_[0] && ref $_[1] && ! blessed $_[0] && ! blessed $_[1];
+ return $_[0] eq $_[1];
}
sub copy {
diff -ru lib/File/Copy.t lib2/File/Copy.t
--- lib/File/Copy.t 2007-12-10 04:14:20.000000000 -0500
+++ lib2/File/Copy.t 2007-12-10 05:00:28.000000000 -0500
@@ -11,7 +11,7 @@
my $TB = Test::More->builder;
-plan tests => 60;
+plan tests => 72;
# We're going to override rename() later on but Perl has to see an
+ { -jdv |
From @ribasushiCreated by @ribasushiThe _eq() function used to determine if 'from' and 'to' are the same use overload (); Perl Info
|
From @nwc10Thanks for the bug report, and the patch. On Mon, Oct 06, 2008 at 04:19:10AM -0700, rabbit+bugs@rabbit.us (via RT) wrote:
It doesn't even deal with two IO::Scalar objects, which was the source of the http://rt.perl.org/rt3/Public/Bug/Display.html?id=32135
Is there any particular reason you chose xor over ne ?
Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
From @rurbanThe commit e55c0a8 for which added the lines: # During perl build, we need File::Copy but Scalar::Util might not be fails on cygwin since about 5.11.3 with ../../miniperl Makefile.PL INSTALLDIRS=perl INSTALLMAN1DIR=none Scalar::Util is required by CPAN even if it cannot be loaded at I've instrumented the pp_require stores into %INC. Scalar/Utils.pm is dynamically eval-loaded by: ../../lib/File/Copy.pm:18 but I dont see where it is stored into %INC to avoid the recursion failure. (492:../../lib/File/Copy.pm:18) const(PV(" require Scalar::Util; require Scalar::Util loads Scalar::Util::PP if the XS is not loaded. This is the fix: Inline Patchdiff --git a/make_ext.pl b/make_ext.pl
index de26d84..d31692a 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -34,6 +34,7 @@ my @toolchain = qw(cpan/AutoLoader/lib
cpan/ExtUtils-MakeMaker/lib
cpan/ExtUtils-Manifest/lib
cpan/File-Path/lib
+ cpan/List-Util/lib
);
# Used only in ExtUtils::Liblist::Kid::_win32_ext()
-- Reini Urban |
From @cpansproutOn Mon Dec 10 05:07:13 2007, jdv79 wrote:
It seems your patch was overlooked. Thank you anyway. In the mean time, this was fixed by change 34519/e55c0a828f2. |
@cpansprout - Status changed from 'open' to 'resolved' |
From @cpansproutFixed by 34519/e55c0a828f2. |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#48078 (status was 'resolved')
Searchable as RT48078$
The text was updated successfully, but these errors were encountered: