Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add curl support to CPAN.pm #8013

Closed
p5pRT opened this issue Jul 12, 2005 · 7 comments
Closed

Add curl support to CPAN.pm #8013

p5pRT opened this issue Jul 12, 2005 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 12, 2005

Migrated from rt.perl.org#36514 (status was 'resolved')

Searchable as RT36514$

@p5pRT
Copy link
Author

p5pRT commented Jul 12, 2005

From @schwern

Created by @schwern

It would be nice if CPAN.pm supported curl as a download method.
Particularly because OS X ships with *none* of the currently handled
methods (wget, lynx, ncftp*).

The code for handling curl can be stolen from CPANPLUS.

Perl Info

Flags:
    category=library
    severity=wishlist

Site configuration information for perl v5.8.6:

Configured by schwern at Tue May 10 16:13:13 PDT 2005.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
  Platform:
    osname=darwin, osvers=7.9.0, archname=darwin-thread-multi-2level
    uname='darwin windhund.schwern.org 7.9.0 darwin kernel version 7.9.0: wed mar 30 20:11:17 pst 2005; root:xnuxnu-517.12.7.obj~1release_ppc power macintosh powerpc '
    config_args='-des -Dcc=gcc-3.3 -Dcpp=gcc-3.3 -E -Dprefix=/sw -Dvendorprefix=/sw -Dccflags=-I/sw/include -Dldflags=-L/sw/lib -Dperladmin=none -Uinstallusrbinperl -Dprivlib=/sw/lib/perl5-core/5.8.6 -Dman3dir=/sw/lib/perl5-core/5.8.6/man/man3 -Dman3ext=3pm -Dvendorlib=/sw/lib/perl5/5.8.6 -Dvendorman3dir=/sw/lib/perl5/5.8.6/man/man3 -Duseithreads -Dinc_version_list=5.8.1 5.8.0 5.6.0 -Adefine:startperl=#!/sw/bin/perl5.8.6 -Dotherlibdirs=/Library/Perl'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc-3.3', ccflags ='-I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe',
    optimize='-Os',
    cppflags='-no-cpp-precomp -I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe'
    ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1671)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/sw/lib -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-L/sw/lib -bundle -undefined dynamic_lookup -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.8.6:
    /sw/lib/perl5/5.8.6/darwin-thread-multi-2level
    /sw/lib/perl5/5.8.6
    /sw/lib/perl5/5.8.1
    /sw/lib/perl5
    /sw/lib/perl5/darwin
    /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level
    /sw/lib/perl5-core/5.8.6
    /sw/lib/perl5/site_perl/5.8.6/darwin-thread-multi-2level
    /sw/lib/perl5/site_perl/5.8.6
    /sw/lib/perl5/site_perl
    /sw/lib/perl5/5.8.6/darwin-thread-multi-2level
    /sw/lib/perl5/5.8.6
    /sw/lib/perl5/5.8.1
    /sw/lib/perl5
    /Library/Perl/5.8.1
    /Library/Perl
    .


Environment for perl v5.8.6:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/schwern
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/schwern/bin:/usr/local/bin:/Users/schwern/bin:/usr/local/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/schwern:/usr/X11R6/bin:.:.
    PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jul 15, 2005

From @schwern

[schwern@​windhund.schwern.org - Tue Jul 12 03​:24​:42 2005]​:

It would be nice if CPAN.pm supported curl as a download method.
Particularly because OS X ships with *none* of the currently handled
methods (wget, lynx, ncftp*).

Well that was surprisingly easy. Patch attached.

It makes curl the first choice since its the most capable of all the
options handling pretty much every schema type you'd ever want short of
rsync. (HTTP, HTTPS, FTP, FTPS, GOPHER, DICT, TELNET, LDAP or FILE)

@p5pRT
Copy link
Author

p5pRT commented Jul 15, 2005

From @schwern

CPAN_curl.patch
--- lib/CPAN.pm	2005/07/15 08:58:37	1.1
+++ lib/CPAN.pm	2005/07/15 09:07:04
@@ -2634,26 +2634,27 @@
                                            # success above. Likely a bogus URL
 
 	$self->debug("localizing funkyftpwise[$url]") if $CPAN::DEBUG;
-	my($f,$funkyftp);
 
-        # Try the most capable first (wget does HTTP, HTTPS and FTP) and
-        # leave ncftp* for last as it only does FTP.
-	for $f (qw(wget lynx ncftpget ncftp)) {
-	  next unless exists $CPAN::Config->{$f};
-	  $funkyftp = $CPAN::Config->{$f};
-	  next unless defined $funkyftp;
+        # Try the most capable first and leave ncftp* for last as it only 
+        # does FTP.
+	for my $f (qw(curl wget lynx ncftpget ncftp)) {
+          my $funkyftp = $CPAN::Config->{$f};
+          next unless defined $funkyftp;
 	  next if $funkyftp =~ /^\s*$/;
+
 	  my($asl_ungz, $asl_gz);
 	  ($asl_ungz = $aslocal) =~ s/\.gz//;
           $asl_gz = "$asl_ungz.gz";
+
 	  my($src_switch) = "";
 	  if ($f eq "lynx"){
 	    $src_switch = " -source";
 	  } elsif ($f eq "ncftp"){
 	    $src_switch = " -c";
           } elsif ($f eq "wget"){
-              $src_switch = " -O -";
+            $src_switch = " -O -";
 	  }
+
 	  my($chdir) = "";
 	  my($stdout_redir) = " > $asl_ungz";
 	  if ($f eq "ncftpget"){
@@ -2729,7 +2730,7 @@
 });
 	  }
           return if $CPAN::Signal;
-	} # wget,lynx,ncftpget,ncftp
+	} # transfer programs
     } # host
 }
 
--- lib/CPAN/FirstTime.pm	2005/07/15 09:04:12	1.1
+++ lib/CPAN/FirstTime.pm	2005/07/15 09:04:24
@@ -292,7 +292,10 @@
     my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'};
     local $^W = $old_warn;
     my $progname;
-    for $progname (qw/gzip tar unzip make lynx wget ncftpget ncftp ftp gpg/){
+    for $progname (qw/gzip tar unzip make 
+                      curl lynx wget ncftpget ncftp ftp 
+                      gpg/)
+    {
       if ($^O eq 'MacOS') {
           $CPAN::Config->{$progname} = 'not_here';
           next;

@p5pRT
Copy link
Author

p5pRT commented Jul 15, 2005

@schwern - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 15, 2005

From @steve-m-hay

Michael G Schwern via RT wrote​:

[schwern@​windhund.schwern.org - Tue Jul 12 03​:24​:42 2005]​:

It would be nice if CPAN.pm supported curl as a download method.
Particularly because OS X ships with *none* of the currently handled
methods (wget, lynx, ncftp*).

Well that was surprisingly easy. Patch attached.

Thanks. Applied as change 25155.


Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses​: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.

@p5pRT
Copy link
Author

p5pRT commented Jul 15, 2005

From @steve-m-hay

Now fixed in bleadperl.

@p5pRT p5pRT closed this as completed Jul 15, 2005
@p5pRT
Copy link
Author

p5pRT commented Jul 15, 2005

@steve-m-hay - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant