Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix server backend tests

  • Loading branch information...
commit f565f1154c1f01c44e777914e2358c9cfa0a3a82 1 parent 0d2897a
@samoht samoht authored
View
4 src/client.ml
@@ -1441,9 +1441,7 @@ let upload upload repo =
Filename.copy upload.descr upload_descr;
Filename.copy upload.archive upload_archives;
Repositories.upload repo;
- Filename.remove upload_opam;
- Filename.remove upload_descr;
- Filename.remove upload_archives
+ Dirname.rmdir (Path.R.package upload_repo nv)
(* Return the transitive closure of dependencies *)
let get_transitive_dependencies t names =
View
3  src/path.ml
@@ -19,6 +19,7 @@ open Utils
let log fmt = Globals.log "PATH" fmt
let available_packages dir =
+ log "available_packages %s" (Dirname.to_string dir);
let files = Filename.list dir in
let files = List.filter (fun f -> Filename.check_suffix f ".opam") files in
List.fold_left (fun set file ->
@@ -30,6 +31,7 @@ let available_packages dir =
) NV.Set.empty files
let available_compilers dir =
+ log "available_compilers %s" (Dirname.to_string dir);
if Dirname.exists dir then (
let files = Filename.list dir in
let files = List.filter (fun f -> Filename.check_suffix f ".comp") files in
@@ -160,6 +162,7 @@ module R = struct
let packages_dir t = t / "packages"
let available_packages t =
+ log "available_packages %s" (Dirname.to_string t);
let all = Dirname.list (packages_dir t) in
let basenames = List.map Dirname.basename all in
NV.Set.of_list (List.map (Basename.to_string |> NV.of_string) basenames)
View
12 src/repo/server/daemon.ml
@@ -27,17 +27,17 @@ type t = {
available: NV.Set.t
}
+let load_root () =
+ Path.R.of_dirname (Dirname.of_string !Globals.root_path)
+
let init () =
- log "init server state";
- let t = Path.R.of_dirname (Dirname.cwd ()) in
+ let t = load_root () in
+ log "init server state (%s)" (Dirname.to_string (Path.R.root t));
Dirname.mkdir (Path.R.packages_dir t);
Dirname.mkdir (Path.R.compilers_dir t);
Dirname.mkdir (Path.R.archives_dir t);
Dirname.mkdir (Key.hashes_dir t)
-let load_root () =
- Path.R.of_dirname (Dirname.cwd ())
-
let load_state () =
let root = load_root () in
let available = Path.R.available_packages root in
@@ -69,7 +69,7 @@ let process_request id = function
else
Error "Wrong API version"
| GetList ->
- log "GetList";
+ log "GetList %s" !Globals.root_path;
let t = load_state () in
let l = NV.Set.fold (fun nv l ->
(N.to_string (NV.name nv), V.to_string (NV.version nv)) :: l
View
13 src/repo/server/init.ml
@@ -6,9 +6,12 @@ let _ =
exit 1
)
+open Types
+
+let t = Path.R.of_dirname (Dirname.cwd ())
+
let () =
- Run.mkdir "opam";
- Run.mkdir "descr";
- Run.mkdir "archives";
- Run.mkdir "compilers";
- Run.mkdir "keys"
+ Dirname.mkdir (Path.R.archives_dir t);
+ Dirname.mkdir (Path.R.compilers_dir t);
+ Dirname.mkdir (Path.R.packages_dir t)
+
View
1  src/repo/server/server.ml
@@ -71,6 +71,7 @@ let init_server () =
Unix.setsockopt socket Unix.SO_REUSEADDR true ;
Unix.bind socket addr;
Unix.listen socket 10;
+ Run.mkdir !Globals.root_path;
socket
let run_server () =
View
7 tests/Makefile
@@ -83,11 +83,13 @@ $(BINARIES_): $(BUILDS)
binaries: $(BINARIES_)
init:
+ifneq ($(REPOKIND), server)
rm -rf $(OPAM_REPO)
mkdir -p $(OPAM_REPO)
mkdir $(OPAM_REPO)/opam
mkdir $(OPAM_REPO)/descr
mkdir $(OPAM_REPO)/compilers
+endif
ifeq ($(REPOKIND), git)
mkdir $(OPAM_REPO)/url
cd $(OPAM_REPO) && git init && \
@@ -245,4 +247,7 @@ clean:
rm -f $(ARCHIVES)
fresh:
- rm -rf $(OPAM_ROOT) $(OPAM_REPO) $(BIN)
+ rm -rf $(OPAM_ROOT) $(BIN)
+ifneq ($(REPOKIND), server)
+ rm -rf $(OPAM_REPO)
+endif
Please sign in to comment.
Something went wrong with that request. Please try again.