I have installed just one ftp client on my machine and it's lftp, so i have ftp
as symbolic link (ln -s /usr/bin/lftp /usr/bin/ftp) to lftp. Here's the
problem, using CPAN perl archives:
$ perl -MCPAN -e shell
Issuing "/usr/bin/ftp -n"
lftp: invalid option -- n
Try `lftp --help' for more information

Subprocess "|/usr/bin/ftp -n"
  returned status 1 (wstat 256)
Bad luck... Still failed!
Can't access URL ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.

As shown perl has failed to execute external ftp client and was unable to get
needed file from CPAN archives.
So is it possible to make lftp support '-n' command line switch for backward
compatibility with old ftp? as said in 'man ftp' :
-- cut 'man ftp'
     -n    Restrains ftp from attempting ``auto-login'' upon initial connec­
           tion.  If auto-login is enabled, ftp will check the .netrc (see
           netrc(5)) file in the user's home directory for an entry describing
           an account on the remote machine.  If no entry exists, ftp will
           prompt for the remote machine login name (default is the user iden­
           tity on the local machine), and, if necessary, prompt for a pass­
           word and an account with which to login.
-- cut

which is default behaviour of lftp.

I'm writen patch to make it work for me, you can check it for errors and
apply if needed.
Thanks and regards!

--- commands.cc-orig    Wed Jun 26 16:59:01 2002
+++ commands.cc Wed Jun 26 17:29:41 2002
@@ -284,6 +284,7 @@
         " -e <cmd>            execute the command just after selecting\n"
         " -u <user>[,<pass>]  use the user/password for authentication\n"
         " -p <port>           use the port for connection\n"
+        " -n                  backward compatibility\n"
         " <site>              host name, URL or bookmark name\n")},
    {"lpwd",    cmd_lpwd},
    {"login",   cmd_user,   0,"user"},
@@ -707,7 +708,7 @@
    bool no_bm=false;
-   while((c=args->getopt("u:p:e:dB"))!=EOF)
+   while((c=args->getopt("u:p:e:dB:n"))!=EOF)
@@ -736,6 +737,8 @@
+      case('n'):
+        break;
            eprintf(_("Try `%s --help' for more information\n"),op);
@@ -1291,7 +1294,7 @@
    int opt, longopt;
-   while((opt=a->getopt_long(":1BdFhiklqsDIS", cls_options, &longopt))!=EOF)
+   while((opt=a->getopt_long(":1BdFhiklnqsDIS", cls_options, &longopt))!=EOF)
       switch(opt) {
       case 0:
@@ -1360,6 +1363,8 @@
         sort = FileSet::BYSIZE;
+      case('n'):
+        break;
         /* silly getopt won't give us its error instead of printing it, oh well.


Reply via email to