From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9801 invoked by alias); 11 Jul 2011 13:01:19 -0000 Received: (qmail 9784 invoked by uid 22791); 11 Jul 2011 13:01:18 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qy0-f178.google.com (HELO mail-qy0-f178.google.com) (209.85.216.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jul 2011 13:00:44 +0000 Received: by qyk27 with SMTP id 27so2486290qyk.2 for ; Mon, 11 Jul 2011 06:00:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.18.81 with SMTP id v17mr3643101qca.7.1310389243798; Mon, 11 Jul 2011 06:00:43 -0700 (PDT) Received: by 10.229.105.135 with HTTP; Mon, 11 Jul 2011 06:00:43 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Jul 2011 13:01:00 -0000 Message-ID: Subject: Re: Perl's ExtUtils::MakeMaker fails and proposed fix From: Reini Urban To: cygwin@cygwin.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-07/txt/msg00124.txt.bz2 2011/7/11 Reini Urban: > 2011/7/7 Marco Moreno: >> After doing a little debugging, I discovered why installing ExtUtils::Ma= keMaker >> was failing for me. =A0ExtUtils::MM_Cygwin.pm contains: >> >> =3Ditem maybe_command >> >> If our path begins with F then we use C >> to determine if it may be a command. =A0Otherwise we use the tests >> from C. >> >> =3Dcut >> >> sub maybe_command { >> =A0 =A0my ($self, $file) =3D @_; >> >> =A0 =A0if ($file =3D~ m{^/cygdrive/}i) { >> =A0 =A0 =A0 =A0return ExtUtils::MM_Win32->maybe_command($file); >> =A0 =A0} >> >> =A0 =A0return $self->SUPER::maybe_command($file); >> } >> >> >> Obviously, if your cygdrive prefix is something else (e.g. '/'), then >> this will fail. >> >> What do you think of this instead: >> >> =3Ditem maybe_command >> >> Determine whether a file is native to Cygwin by checking whether it >> resides inside the Cygwin installation (using Windows paths). =A0If so, >> use C to determine if it may be a command. >> Otherwise use the tests from C. >> >> =3Dcut >> >> sub maybe_command { >> =A0 =A0my ($self, $file) =3D @_; >> >> =A0 =A0my $cygwin_winpath =3D Cygwin::posix_to_win_path('/', 1); >> =A0 =A0my $file_winpath =3D Cygwin::posix_to_win_path($file, 1); >> >> =A0 =A0return ($file_winpath =3D~ /^${cygwin_winpath}/) >> =A0 =A0 =A0 =A0? $self->SUPER::maybe_command($file) >> =A0 =A0 =A0 =A0: ExtUtils::MM_Win32->maybe_command($file); >> } I improved it a bit, because I don't like userdata end up in regexp. my $cygpath =3D Cygwin::posix_to_win_path('/', 1); my $filepath =3D Cygwin::posix_to_win_path($file, 1); return (substr($filepath,0,length($cygpath)) eq $cygpath) ? $self->SUPER::maybe_command($file) # Unix : ExtUtils::MM_Win32->maybe_command($file); # Win32 >> >> >> This passed all the tests and installed ok for me. =A0Does this look >> ok to you and is it reasonable to assume that native Cygwin >> commands will always be inside the Cygwin installation directory? >> If this proposed change is worthy of implementing, what is the best >> way to do it? =A0rt.cpan.org? > > Sorry, I did not come to test this this weekend. > > Yes, this uncommon cornercase looks worthy to be fixed. > Please file a perlbug for this. It should go to rt.perl.org. I just added it as https://rt.perl.org/rt3/Ticket/Display.html?id=3D94532 --=20 Reini -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple