Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

check that ".install" can be parsed at upload time, instead of instal…

…l time
  • Loading branch information...
commit 06d7645d63a7663c215ac6a3f3da16aeb0ba1693 1 parent 7591c32
@tuong tuong authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/client.ml
View
16 src/client.ml
@@ -652,7 +652,21 @@ module Client : CLIENT = struct
let nv = name, version in
let tmp_nv = Path.concat Path.cwd (B (Namespace.string_of_nv (fst nv) (snd nv))) in
let () =
- begin
+ begin
+ ((* try to check that patches are well-parsed before the copy *)
+ List.iter
+ (function Internal p ->
+ if not (Sys.is_directory p) && Filename.check_suffix p "install" then
+ (try ignore (File.To_install.parse (Run.read p)) with e ->
+ Globals.error_and_exit "%s\nwhile parsing '%s'." (Printexc.to_string e) p)
+ else
+ () (* TODO perform the recursive check for a directory.
+ Change [Path.add_rec] such that it accepts an optional checking function. *)
+ | _ -> ())
+ patches;
+ );
+
+ (* include the patches inside the downloaded directory *)
Path.add_rec tmp_nv (Path.extract nv (Links { urls ; patches }));
Path.to_archive archive_filename tmp_nv;
Path.remove tmp_nv;
Please sign in to comment.
Something went wrong with that request. Please try again.