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