[projects/distfiles] (Temporarily) support both scp and ftp

mmazur mmazur at pld-linux.org
Thu Jan 23 09:55:33 CET 2014


commit 453b0d4befc8758152801bf49cc3124b191593e8
Author: Mariusz Mazur <mmazur at pld-linux.org>
Date:   Wed Jan 22 17:28:35 2014 +0100

    (Temporarily) support both scp and ftp

 file-fetcher.pl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/file-fetcher.pl b/file-fetcher.pl
index 55e7c23..d012d2d 100755
--- a/file-fetcher.pl
+++ b/file-fetcher.pl
@@ -219,18 +219,20 @@ sub handle_no_url($$)
     return;
   }
   my $basename = $1;
-  my $file = "$no_url_dir/$req_login/$basename";
+  my $file = "$no_url_dir/$basename";
+
+  $file = "$no_url_dir/$req_login/$basename" unless (-f $file);
 
   if (-f $file) {
     my $computed_md5 = md5($file);
     if ($computed_md5 ne $md5) {
-      $problems .= "FATAL: $file md5 mismatch, needed $md5, got $computed_md5\n";
+      $problems .= "FATAL: $basename md5 mismatch, needed $md5, got $computed_md5\n";
     } else {
       move_file($md5, $url, $file);
       make_src_symlink($md5, $url);
     }
   } else {
-    $problems .= "FATAL: $file was not uploaded\n";
+    $problems .= "FATAL: $basename was not uploaded\n";
   }
 }
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/distfiles.git/commitdiff/453b0d4befc8758152801bf49cc3124b191593e8



More information about the pld-cvs-commit mailing list