Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better fix for opam-repository#10

for the curl backend, always download files - never dirs
  • Loading branch information...
commit e1e542b22ccbe4b212b8ac74ee77f5324161ac8a 1 parent 14eaad3
@samoht samoht authored
Showing with 2 additions and 9 deletions.
  1. +2 −2 src/repositories.ml
  2. +0 −5 src/run.ml
  3. +0 −2  src/run.mli
View
4 src/repositories.ml
@@ -81,7 +81,7 @@ let download_file k nv f =
log "download_file %s %s %s" k (NV.to_string nv) (Filename.to_string f);
let module B = (val find_backend_by_kind k: BACKEND) in
let rename file =
- if Run.is_github_tarball (Filename.to_string f) then
+ if k = "curl" && not (Run.is_tar_archive (Filename.to_string f)) then
let new_file = Filename.raw (Filename.to_string file ^ ".tar.gz") in
Filename.move file new_file;
new_file
@@ -99,7 +99,7 @@ let download_dir k nv d =
let download_one k nv url =
let f x = F x in
let d x = D x in
- if Run.is_tar_archive url || Run.is_github_tarball url then
+ if k = "curl" || Run.is_tar_archive url then
map f (download_file k nv (Filename.raw url))
else
map d (download_dir k nv (Dirname.raw url))
View
5 src/run.ml
@@ -309,11 +309,6 @@ end
let is_tar_archive = Tar.is_archive
-let is_github_tarball s =
- (Utils.starts_with ~prefix:"https://github.com/" s
- || Utils.starts_with ~prefix:"http://github.com/" s)
- && Filename.basename (Filename.dirname s) = "tarball"
-
let extract file dst =
log "extract %s %s" file dst;
(* let files = read_command_output [ "tar" ; "tf" ; file ] in
View
2  src/run.mli
@@ -96,8 +96,6 @@ val read_command_output:
(** Test whether the file is an archive, by looking as its extension *)
val is_tar_archive: string -> bool
-val is_github_tarball: string -> bool
-
(** [extract filename dirname] extracts the archive [filename] into
[dirname]. [dirname] should not exists and [filename] should
contain only one top-level directory.*)
Please sign in to comment.
Something went wrong with that request. Please try again.