Skip Menu |

This queue is for tickets about the CPAN-Site CPAN distribution.

Report information
The Basics
Id: 81202
Status: resolved
Priority: 0/
Queue: CPAN-Site

People
Owner: Nobody in particular
Requestors: ALUCAS [...] cpan.org
Cc: anthony_lucas [...] discovery.com
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



CC: anthony_lucas [...] discovery.com
Subject: Windows path escaping
Hi, I've been using this module for a Perl Continuous Integration server. It's awesome. I've noticed that on some of the windows build nodes running strawberry perl (5.16.1), the regexp on line 187 can cause issues because it uses the $topdir variable, which could contain a windows path which includes backslashes. As you can imagine, they just need to be escaped or normalised to forward slashes before being put into the regexp. I've made the change locally for the time being, but it would be nice if this was eventually fixed in the CPAN version. It's such a small thing there's no real point in attaching a patch (unless you want me to). I had a quick look on github but I couldn't find an account for you so I imagine it's not on there. (Set to important as even though it's small, it is a show-stopper) Thanks Mark.
Subject: Re: [rt.cpan.org #81202] Windows path escaping
Date: Thu, 15 Nov 2012 20:13:19 +0100
To: Anthony J Lucas via RT <bug-CPAN-Site [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Anthony J Lucas via RT (bug-CPAN-Site@rt.cpan.org) [121115 17:24]: Show quoted text
> Thu Nov 15 12:24:23 2012: Request 81202 was acted upon. > Transaction: Ticket created by ALUCAS > Subject: Windows path escaping > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81202 > > > > I've been using this module for a Perl Continuous Integration server. > It's awesome. > > I've noticed that on some of the windows build nodes running strawberry > perl (5.16.1), the regexp on line 187 can cause issues because it uses > the $topdir variable, which could contain a windows path which includes > backslashes.
It currently is (my $dist = $fn) =~ s!^$topdir[\\/]!!; Which means: either a forward or a backslash. What do you propose? Show quoted text
> It's such a small thing there's no real point in attaching a patch > (unless you want me to). I had a quick look on github but I couldn't > find an account for you so I imagine it's not on there.
I do never use Windows. Do the tests run on Windows? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
CC: ALUCAS [...] cpan.org, anthony_lucas [...] discovery.com
Subject: Re: [rt.cpan.org #81202] Windows path escaping
Date: Thu, 15 Nov 2012 20:12:51 +0000
To: bug-CPAN-Site [...] rt.cpan.org
From: Anthony Lucas <anthonyjlucas [...] gmail.com>
On 15 November 2012 19:13, Mark Overmeer via RT <bug-CPAN-Site@rt.cpan.org> wrote: Show quoted text
>
> > I've noticed that on some of the windows build nodes running strawberry > > perl (5.16.1), the regexp on line 187 can cause issues because it uses > > the $topdir variable, which could contain a windows path which includes > > backslashes.
> > It currently is > (my $dist = $fn) =~ s!^$topdir[\\/]!!; > > Which means: either a forward or a backslash. What do you propose?
If $topdir contains a backslash then the regexp won't do the right thing (because it will be seen as an escape sequence along with the next character and not a part of the path). I simply copied $topdir to a local var and then ran a s!\\!/!g on it. Show quoted text
> > > I do never use Windows. Do the tests run on Windows?
Yes, they do! and pass ...but they don't catch this. If there are any other issues picked up whilst I get things building on Windows I will make sure to file bugs w/ patches where I can. This module works amazingly well for CI because you can dynamically build a private cpan repository for every build run, pulling in the latest tarballs from other upstream jobs and indexing them, ready for your build script to pull deps from.
Subject: Re: [rt.cpan.org #81202] Windows path escaping
Date: Thu, 15 Nov 2012 23:47:49 +0100
To: Anthony Lucas via RT <bug-CPAN-Site [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Anthony Lucas via RT (bug-CPAN-Site@rt.cpan.org) [121115 20:13]: Show quoted text
> Queue: CPAN-Site > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81202 > > > On 15 November 2012 19:13, Mark Overmeer via RT > <bug-CPAN-Site@rt.cpan.org> wrote:
> > > > It currently is > > (my $dist = $fn) =~ s!^$topdir[\\/]!!; > >
> If $topdir contains a backslash then the regexp won't do the right > thing (because it will be seen as an escape sequence along with the > next character and not a part of the path). > I simply copied $topdir to a local var and then ran a s!\\!/!g on it.
Ah, or (my $dist = $fn) =~ s!^\Q$topdir\E[\\/]!!; -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #81202] Windows path escaping
Date: Sun, 18 Nov 2012 22:14:03 +0100
To: Anthony Lucas via RT <bug-CPAN-Site [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Mark Overmeer (mark@overmeer.net) [121115 23:47]: Show quoted text
> * Anthony Lucas via RT (bug-CPAN-Site@rt.cpan.org) [121115 20:13]:
> > Queue: CPAN-Site > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81202 > > >
> (my $dist = $fn) =~ s!^\Q$topdir\E[\\/]!!;
Released this as v1.11 -- Thanks, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Brilliant! Thanks for the quick response. I'll move everything over to using the new version tomorrow. Cheers On Sun Nov 18 16:14:17 2012, Mark@Overmeer.net wrote: Show quoted text
> * Mark Overmeer (mark@overmeer.net) [121115 23:47]:
> > * Anthony Lucas via RT (bug-CPAN-Site@rt.cpan.org) [121115 20:13]:
> > > Queue: CPAN-Site > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81202 > > > >
> > (my $dist = $fn) =~ s!^\Q$topdir\E[\\/]!!;
> > Released this as v1.11
resolved in 1.11