CC: | bug-ExtUtils-MakeMaker [...] rt.cpan.org |
Subject: | [perl #94532] [PATCH] 93862c2 Stabilize ExtUtils::MM_Cygwin::maybe_command |
Date: | Mon, 11 Jul 2011 06:22:39 -0700 |
To: | "OtherRecipients of perl Ticket #94532":; |
From: | "Father Chrysostomos via RT" <perlbug-comment [...] perl.org> |
On Mon Jul 11 05:58:54 2011, rurban wrote:
Show quoted text
> This is a bug report for perl from rurban@x-ray.at,
> generated with the help of perlbug 1.39 running under perl 5.10.1.
>
> From 93862c2701c9e33e65ba9c64ffd4e05d2ccba735 Mon Sep 17 00:00:00 2001
> From: Reini Urban <rurban@x-ray.at>
> Date: Mon, 11 Jul 2011 14:52:03 +0200
> Subject: [PATCH] Stabilize ExtUtils::MM_Cygwin::maybe_command
> MIME-Version: 1.0
> Content-Type: multipart/mixed; boundary="------------1.7.5.1"
>
> This is a multi-part message in MIME format.
> --------------1.7.5.1
> Content-Type: text/plain; charset=UTF-8; format=fixed
> Content-Transfer-Encoding: 8bit
>
>
> Be independent of /cygdrive prefixes. Failed with a prefix like "/".
> Suggestion by Marco Moreno, patch by Reini Urban.
> ---
> cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm | 18
> ++++++++++--------
> 1 files changed, 10 insertions(+), 8 deletions(-)
>
>
> --------------1.7.5.1
> Content-Type: text/x-patch; name="0001-Stabilize-ExtUtils-MM_Cygwin-
> maybe_command.patch"
> Content-Transfer-Encoding: 8bit
> Content-Disposition: attachment; filename="0001-Stabilize-ExtUtils-
> MM_Cygwin-maybe_command.patch"
>
> diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
> b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
> index d6ce3a7..f7a5c21 100644
> --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
> +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
> @@ -9,7 +9,7 @@ require ExtUtils::MM_Unix;
> require ExtUtils::MM_Win32;
> our @ISA = qw( ExtUtils::MM_Unix );
>
> -our $VERSION = '6.57_05';
> +our $VERSION = '6.57_06';
>
>
> =head1 NAME
> @@ -100,20 +100,22 @@ sub init_linker {
>
> =item maybe_command
>
> -If our path begins with F</cygdrive/> then we use
> C<ExtUtils::MM_Win32>
> -to determine if it may be a command. Otherwise we use the tests
> -from C<ExtUtils::MM_Unix>.
> +Determine whether a file is native to Cygwin by checking whether it
> +resides inside the Cygwin installation (using Windows paths). If so,
> +use C<ExtUtils::MM_Unix> to determine if it may be a command.
> +Otherwise use the tests from C<ExtUtils::MM_Win32>.
>
> =cut
>
> sub maybe_command {
> my ($self, $file) = @_;
>
> - if ($file =~ m{^/cygdrive/}i) {
> - return ExtUtils::MM_Win32->maybe_command($file);
> - }
> + my $cygpath = Cygwin::posix_to_win_path('/', 1);
> + my $filepath = Cygwin::posix_to_win_path($file, 1);
>
> - return $self->SUPER::maybe_command($file);
> + return (substr($filepath,0,length($cygpath)) eq $cygpath)
> + ? $self->SUPER::maybe_command($file) # Unix
> + : ExtUtils::MM_Win32->maybe_command($file); # Win32
> }
>
> =item dynamic_lib
>
> --------------1.7.5.1--
>
>
> ---
> Flags:
> category=library
> severity=medium
> ---
> Site configuration information for perl 5.10.1:
>
> Configured by rurban at Sat Aug 28 20:14:06 CEST 2010.
>
> Summary of my perl5 (revision 5 version 10 subversion 1)
> configuration:
>
> Platform:
> osname=cygwin, osvers=1.7.5(0.22553), archname=i686-cygwin-thread-
> multi-64int
> uname='cygwin_nt-5.1 reini 1.7.5(0.22553) 2010-04-12 19:07 i686
> cygwin '
> config_args='-de -Dlibperl=cygperl5_10.dll -Dcc=gcc-4 -Dld=g++-4
> -Dmksymlinks -Dusethreads -Dmad=y -Doptimize=-O3 -Accflags=-g3'
> hint=recommended, useposix=true, d_sigaction=define
> useithreads=define, usemultiplicity=define
> useperlio=define, d_sfio=undef, uselargefiles=define,
> usesocks=undef
> use64bitint=define, use64bitall=undef, uselongdouble=undef
> usemymalloc=y, bincompat5005=undef
> Compiler:
> cc='gcc-4', ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3
> -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
> optimize='-O3',
> cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g3
> -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
> ccversion='', gccversion='4.3.4 20090804 (release) 1',
> gccosandvers=''
> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
> d_longlong=define, longlongsize=8, d_longdbl=define,
> longdblsize=12
> ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
> Off_t='off_t', lseeksize=8
> alignbytes=8, prototype=define
> Linker and Libraries:
> ld='g++-4', ldflags =' -Wl,--enable-auto-import
> -Wl,--export-all-symbols -Wl,--stack,8388608
> -Wl,--enable-auto-image-base -fstack-protector -L/usr/local/lib'
> libpth=/usr/local/lib /usr/lib /lib
> libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
> perllibs=-ldl -lcrypt
> libc=/usr/lib/libc.a, so=dll, useshrplib=true,
> libperl=cygperl5_10.dll
> gnulibc_version=''
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
> cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import
> -Wl,--export-all-symbols -Wl,--stack,8388608
> -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector'
>
> Locally applied patches:
> CYG11 no-bs
> CYG12 no archlib in otherlibdirs
> CYG14 Dynaloader
> CYG15 static-Win32CORE
> CYG17 utf8-paths
> CYG21 LibList-Kid.patch
> CYG22 cygwin-1.7 hints
> CYG23 544-stat
> CYG24 build man pages
> CYG25 rebase_privlib
> Module-Build-0.36_13
> Bug#55162 CYG18 File::Spec::case_tolerant performance
> disable ExtUtils::MakeMaker::Coverage in Sys-Syslog
>
> ---
> @INC for perl 5.10.1:
> /usr/lib/perl5/5.10/i686-cygwin
> /usr/lib/perl5/5.10
> /usr/lib/perl5/site_perl/5.10/i686-cygwin
> /usr/lib/perl5/site_perl/5.10
> /usr/lib/perl5/vendor_perl/5.10/i686-cygwin
> /usr/lib/perl5/vendor_perl/5.10
> /usr/lib/perl5/vendor_perl/5.10
> /usr/lib/perl5/site_perl/5.8
> /usr/lib/perl5/vendor_perl/5.8
> .
>
> ---
> Environment for perl 5.10.1:
> HOME=/home/urbanr
> LANG=C.UTF-8
> LANGUAGE (unset)
> LD_LIBRARY_PATH (unset)
> LOGDIR (unset)
>
PATH=.:/home/urbanr/bin:~/bin:/usr/local/bin:/usr/bin:/usr/sbin:/cygdrive/c/strawberry/c/bin:/cygdrive/c/WINDOWS/System32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/WBEM:/cygdrive/c/PROGRA~1/ATT/Graphviz/bin:/cygdrive/c/PROGRA~1/ATT/Graphviz/bin/tools:/usr/lib/lapack:/cygdrive/c/oracle/ora112/bin
Show quoted text> PERL_BADLANG (unset)
> SHELL (unset)
From 93862c2701c9e33e65ba9c64ffd4e05d2ccba735 Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@x-ray.at>
Date: Mon, 11 Jul 2011 14:52:03 +0200
Subject: [PATCH] Stabilize ExtUtils::MM_Cygwin::maybe_command
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.5.1"
This is a multi-part message in MIME format.
--------------1.7.5.1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Be independent of /cygdrive prefixes. Failed with a prefix like "/".
Suggestion by Marco Moreno, patch by Reini Urban.
---
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
--------------1.7.5.1
Content-Type: text/x-patch; name="0001-Stabilize-ExtUtils-MM_Cygwin-maybe_command.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Stabilize-ExtUtils-MM_Cygwin-maybe_command.patch"
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
index d6ce3a7..f7a5c21 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
@@ -9,7 +9,7 @@ require ExtUtils::MM_Unix;
require ExtUtils::MM_Win32;
our @ISA = qw( ExtUtils::MM_Unix );
-our $VERSION = '6.57_05';
+our $VERSION = '6.57_06';
=head1 NAME
@@ -100,20 +100,22 @@ sub init_linker {
=item maybe_command
-If our path begins with F</cygdrive/> then we use C<ExtUtils::MM_Win32>
-to determine if it may be a command. Otherwise we use the tests
-from C<ExtUtils::MM_Unix>.
+Determine whether a file is native to Cygwin by checking whether it
+resides inside the Cygwin installation (using Windows paths). If so,
+use C<ExtUtils::MM_Unix> to determine if it may be a command.
+Otherwise use the tests from C<ExtUtils::MM_Win32>.
=cut
sub maybe_command {
my ($self, $file) = @_;
- if ($file =~ m{^/cygdrive/}i) {
- return ExtUtils::MM_Win32->maybe_command($file);
- }
+ my $cygpath = Cygwin::posix_to_win_path('/', 1);
+ my $filepath = Cygwin::posix_to_win_path($file, 1);
- return $self->SUPER::maybe_command($file);
+ return (substr($filepath,0,length($cygpath)) eq $cygpath)
+ ? $self->SUPER::maybe_command($file) # Unix
+ : ExtUtils::MM_Win32->maybe_command($file); # Win32
}
=item dynamic_lib
--------------1.7.5.1--