Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 77987
Status: resolved
Priority: 0/
Queue: CPAN-Uploader

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: suggest upload from url
Date: Sun, 24 Jun 2012 10:56:03 +1000
To: bug-CPAN-Uploader [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
As an idea for a feature it'd be good if cpan-upload could ask the pause server for "Upload this URL". Perhaps whenever the command line is ftp: or http:, cpan-upload ftp://some.where/foo.tar.gz I think this only needs the url passed in the right field of the upload form, whichever that might be. I think the server does the url fetch later, so the immediate form response is only that it's been queued successfully (or not).
Subject: Re: [rt.cpan.org #77987] suggest upload from url
Date: Sat, 19 Jan 2013 09:09:12 +1100
To: bug-CPAN-Uploader [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
The couple of lines below seem to work for me. I'm not sure quite what url protocols the pause would allow, so http, https, ftp, ftps as yet. Maybe a looser pattern like m{^[a-z]{2,}:/} or some such to distinguish a url from a file and let the pause worry if it's good.
--- Uploader.pm.orig 2012-12-25 14:00:47.000000000 +1100 +++ Uploader.pm 2013-01-13 06:51:45.000000000 +1100 @@ -74,10 +74,15 @@ Content => { HIDDENNAME => $self->{user}, CAN_MULTIPART => 1, - pause99_add_uri_upload => File::Basename::basename($file), - SUBMIT_pause99_add_uri_httpupload => " Upload this file from my disk ", - pause99_add_uri_uri => "", - pause99_add_uri_httpupload => [ $file ], + ($file =~ /^(f|ht)tps?:/ + ? (SUBMIT_pause99_add_uri_uri => " Upload this URL ", + pause99_add_uri_uri => $file, + ) + : (SUBMIT_pause99_add_uri_httpupload => " Upload this file from my disk ", + pause99_add_uri_uri => "", + pause99_add_uri_upload => File::Basename::basename($file), + pause99_add_uri_httpupload => [ $file ], + )), ($self->{subdir} ? (pause99_add_uri_subdirtext => $self->{subdir}) : ()), }, );
--- cpan-upload.orig 2012-12-25 14:00:47.000000000 +1100 +++ cpan-upload 2013-01-19 08:59:49.000000000 +1100 @@ -19,7 +19,7 @@ # Process arguments my ($opt, $usage) = describe_options( - "usage: %c [options] file-to-upload", + "usage: %c [options] file-or-url-to-upload...", [ "verbose|v" => "enable verbose logging" ], [ "help|h" => "display this help message" ], @@ -90,7 +90,7 @@ =head1 USAGE - usage: cpan-upload [options] file-to-upload-1 [ file-to-upload-2 ... ] + usage: cpan-upload [options] file-or-url-to-upload... -v --verbose enable verbose logging -h --help display this help message --dry-run do not actually upload anything @@ -100,6 +100,24 @@ -d --directory a dir in your CPAN space in which to put the file --http-proxy URL of the http proxy to use in uploading +Each file or URL on the command line is uploaded to the PAUSE, as per the +"Upload a file to CPAN" at the PAUSE web site. + +=over + +https://pause.perl.org:443/pause/authenquery?ACTION=add_uri + +=back + +Files to upload can be from your local disk + + cpan-upload My-File-1.23.tar.gz Another-4.56.tar.gz + +Or if you already have a file available on the web elsewhere then give the +URL to have PAUSE fetch it from there. HTTP and FTP are supported. + + cpan-upload ftp://foo.org/some/where/My-File-1.23.tar.gz + =head1 CONFIGURATION If you have a C<.pause> file in your home directory, it will be checked for a
Thanks for the patch. I don't think I want to apply it in its current form. CPAN::Uploader, instead, should be given a upload_url method, or more likely a scheduled_uri_for_retrieval method. (Once I say that, I feel like this isn't maybe such a great fit for CPAN::Uploader, but I'm not sure.) The command line program should then take an option --uri to indicate that the given name is a URI and not a file. No guessing. -- rjbs
Subject: Re: [rt.cpan.org #77987] suggest upload from url
Date: Sat, 13 Jul 2013 10:36:38 +1000
To: bug-CPAN-Uploader [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Ricardo Signes via RT" <bug-CPAN-Uploader@rt.cpan.org> writes: Show quoted text
> > The command line program should then take an option --uri to indicate > that the given name is a URI and not a file. No guessing.
I've found it convenient not to have to say something like --uri. On the command line a name like http://... is pretty clearly a url as far as the user is concerned. Though at what point the code might notice this would be another matter.
I suspect this can be closed now?
yupper, thanks -- rjbs