Commits

Anonymous committed 6613e06 Draft

works 'without cache'

  • Participants
  • Parent commits 13733db

Comments (0)

Files changed (1)

File src/post_template.ml

 
       let get_sources_cache pd ~dest ~rkind ~dlfunc ~cachedir =
 (*
-        .
-
-        учитывать, что source = `Remote и s_kind = `Dir -- assert false
 *)
 ( ignore pd ; ignore dest ; ignore rkind ; ignore dlfunc ; ignore cachedir ; failwith "qwe" )
 
                     pkg_name path
                   in
                   path
-              | `Remote (_kind, dlfunc) ->
+              | `Remote (rkind, dlfunc) ->
                   let () = cachedbg "package %S is remote, downloading"
                     pkg_name
                   in
-                  let path = dlfunc ~dl_dest:dest in
+                  let dl_dest =
+                    match rkind with
+                    | `Repo -> dest
+                    | `File ->
+                        let temp = Filename.temp_dir_name in
+                        let () = cachedbg "remote file, downloading to %S"
+                          temp
+                        in
+                          temp
+                  in
+                  let path = dlfunc ~dl_dest in
                   let () = cachedbg "package %S downloaded to %S"
                     pkg_name path in
                   path