]> git.pld-linux.org Git - projects/distfiles.git/commitdiff
(Temporarily) support both scp and ftp
authorMariusz Mazur <mmazur@pld-linux.org>
Wed, 22 Jan 2014 16:28:35 +0000 (17:28 +0100)
committerMariusz Mazur <mmazur@pld-linux.org>
Wed, 22 Jan 2014 16:28:35 +0000 (17:28 +0100)
file-fetcher.pl

index 55e7c23be41d7b4565bc1de1fd3fab4f992b34cb..d012d2d696ac9a563878862e0e0c35ffb05e02b8 100755 (executable)
@@ -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";
   }
 }
 
This page took 0.161353 seconds and 4 git commands to generate.