Skip Menu |
 

This queue is for tickets about the File-Fetch CPAN distribution.

Report information
The Basics
Id: 11207
Status: stalled
Priority: 0/
Queue: File-Fetch

People
Owner: Nobody in particular
Requestors: corion [...] corion.net
Cc:
AdminCc:

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



Date: Mon, 24 Jan 2005 21:47:01 +0100
From: Max Maischein <corion [...] corion.net>
To: bug-File-Fetch [...] rt.cpan.org
Subject: File::Fetch v0.07 does not respect the hostname for file:// URIs
Download (untitled) / with headers
text/plain 434b
Hi Jos, a problem I already reported for CPANPLUS was now moved to File::Fetch: In lib/File/Fetch.pm v0.07, line 145+ ### file:// paths have no host ### if( $href->{scheme} eq 'file' ) { $href->{path} = $uri; $href->{host} = ''; This is simply wrong. At least under Win32, a file path (as UNC) can well have, and has on my CPANPLUS setup, a hostname. So the fix is not to (re)set the hostname. -max
From: "Jos I. Boumans" <kane [...] dwim.org>
Subject: Re: [cpan #11207] File::Fetch v0.07 does not respect the hostname for file:// URIs
Date: Mon, 24 Jan 2005 22:05:49 +0100
To: bug-File-Fetch [...] rt.cpan.org
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.2k
On Jan 24, 2005, at 9:47 PM, Max Maischein via RT wrote: Show quoted text
> > This message about File-Fetch was sent to you by corion@corion.net > <corion@corion.net> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=11207 > > > Hi Jos, > > a problem I already reported for CPANPLUS was now moved to File::Fetch: > > In lib/File/Fetch.pm v0.07, line 145+ > > ### file:// paths have no host ### > if( $href->{scheme} eq 'file' ) { > $href->{path} = $uri; > $href->{host} = ''; > > This is simply wrong. At least under Win32, a file path (as UNC) can > well have, and has on my CPANPLUS setup, a hostname. So the fix is not > to (re)set the hostname. > > -max
Perhaps, but what is the difference (in a string) between: file://server/some/dir and file://path/to/some/dir from a URI perspective, they are identical... in the old CPANPLUS it actually mattered if the host got passed specifically or not, but for File::Fetch i dont think it should matter. Have you tried the synopsis example and see if you can fetch a file from a share like that? -- Jos Boumans "Two rules to success in life: 1. Don't tell people everything you know" --Sassan Tat CPANPLUS http://cpanplus.sf.net
... my reply doesn't seem to arrive here - most likely I've sent it to the wrong address :) I will send the mail again, with the full sessions of File::Fetch and LWP::Simple. The gist of it is though (from memory): C<aliens> is my Samba box, that exports a samba share "cpan" From my Win32 machine, this share is reachable as the UNC name "\\aliens\cpan". There is no drive letter connected. perl -MFile::Fetch -e "File::Fetch('file://aliens/cpan/minicpan/authors/01modules.txt.gz')->fetch()" dies. perl -MLWP::Simple -e "getprint 'file://aliens/cpan/minicpan/authors/01modules.txt.gz', '01modules.txt.gz'" works. The reason for this behaviour is (in lib/File/Fetch.pm v0.07, around line 140) that, for file:// URIs, the hostname is explicitly set to be empty. Which is wrong. The "correct" (for certain values of correct, for example, OS) way of not supplying a hostname in a file:/// uri would be to use file:///cpan/minicpan, which would be equivalent to file://localhost/cpan/minicpan and could be interpreted to point to the path /cpan/minicpan . -max
Download (untitled) / with headers
text/plain 991b
[...] Show quoted text
> C<aliens> is my Samba box, that exports a samba share "cpan" > From my Win32 machine, this share is reachable as > the UNC name "\\aliens\cpan". There is no drive letter > connected. > > perl -MFile::Fetch -e > "File::Fetch('file://aliens/cpan/minicpan/authors/01modules.txt.gz')-
> >fetch()"
> > dies. > > perl -MLWP::Simple -e "getprint > 'file://aliens/cpan/minicpan/authors/01modules.txt.gz', > '01modules.txt.gz'" > > works.
In addition, the "documentation" output to the user by CPANPLUS during setup in CPANPLUS::Configure::Setup claims (correctly) : Note that if you want to use a local depository, you will have to enter as follows: file://server/path/to/cpan if the file is on a server on your local network or as: file:///path/to/cpan if the file is on your local disk. Note the three /// after the file: bit and as CPANPLUS relies on File::Fetch, it should either have that documentation removed or, preferrably, that bug should be fixed. -max


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.