]> git.pld-linux.org Git - projects/distfiles.git/blobdiff - file-fetcher.pl
- add alternative passive-ftp; untested
[projects/distfiles.git] / file-fetcher.pl
index e9fe1f49591b1376e2aad3e21a369b32bb5bcca1..8b299a25af999dce60aaf1eb8714d645497f2b7d 100644 (file)
@@ -199,6 +199,7 @@ sub fetch_file($$)
   my $bn = basename($url);
   my $local = "$tmp_dir/$md5/$bn";
   my $cmd = "wget -nv -O $local \"$url\"";
+  my $cmd2 = "wget -nv --passive-ftp -O $local \"$url\"";
 
   push @files, $bn;
 
@@ -227,6 +228,18 @@ sub fetch_file($$)
   if ($out ne "") {
     $problems .= "$cmd:\n$out\n\n";
   }
+  if (-f $local && -s $local > 0 && $url =~ /^ftp:/) {
+    open(W, "$cmd2 2>&1 |");
+    while (<W>) {
+      $all_out .= $_;
+      /URL:.*\s+\-\>\s+.*/ and next;
+      $out .= $_;
+    }
+    close(W);
+    if ($out ne "") {
+      $problems .= "$cmd:\n$out\n\n";
+    }
+  }
   if (-f $local && -s $local > 0) {
     my $computed_md5 = md5($local);
     if ($computed_md5 ne $md5) {
This page took 0.029712 seconds and 4 git commands to generate.