Permalink
Browse files

fix "opam list" (tests was wrong during the 'upgrade' rule)

  • Loading branch information...
tuong committed May 14, 2012
1 parent d09171c commit f6f4b18ba95e7265a8da1f25c60fb898576f498c
Showing with 17 additions and 11 deletions.
  1. +8 −3 src/client.ml
  2. +6 −6 src/opam.ml
  3. +3 −2 tests/Makefile
View
@@ -226,11 +226,16 @@ let list () =
(fun nv (map, max_n, max_v) ->
let name = NV.name nv in
let version = NV.version nv in
- if N.Map.mem name map then
+ if
+ N.Map.mem name map (* If the packet has been processed yet *)
+ &&
+ fst (N.Map.find name map) <> None
+ (* If moreover the version processed was the version that is installed.
+ NB at the time of writing there is at most only 1 [version]
+ installed for a given [name]. *)
+ then
map, max_n, max_v
else
- (* If the packet has not been processed yet or
- if it has been processed but the version processed was not installed *)
let is_installed = NV.Set.mem nv installed in
let descr_f = File.Descr.read (Path.G.descr t.global nv) in
let synopsis = File.Descr.synopsis descr_f in
View
@@ -155,7 +155,7 @@ let config = {
Client.config config
}
-(* ocp-get install PACKAGE *)
+(* opam install PACKAGE *)
let install = {
name = "install";
usage = "[package]+";
@@ -166,7 +166,7 @@ let install = {
main = parse_args (List.iter (fun name -> Client.install (N.of_string name)))
}
-(* ocp-get update *)
+(* opam update *)
let update = {
name = "update";
usage = "[package]+";
@@ -177,7 +177,7 @@ let update = {
main = Client.update;
}
-(* ocp-get upgrade *)
+(* opam upgrade *)
let upgrade = {
name = "upgrade";
usage = "";
@@ -188,7 +188,7 @@ let upgrade = {
main = Client.upgrade;
}
-(* ocp-get upload PACKAGE *)
+(* opam upload PACKAGE *)
let opam = ref ""
let descr = ref ""
let archive = ref ""
@@ -219,7 +219,7 @@ let upload = {
Client.upload { opam; descr; archive } repo)
}
-(* ocp-get remove PACKAGE *)
+(* opam remove PACKAGE *)
let remove = {
name = "remove";
usage = "";
@@ -230,7 +230,7 @@ let remove = {
main = parse_args (List.iter (fun n -> Client.remove (N.of_string n)));
}
-(* ocp-get remote [-list|-add <url>|-rm <url>] *)
+(* opam remote [-list|-add <url>|-rm <url>] *)
let remote =
let git_repo = ref false in
{
View
@@ -44,7 +44,7 @@ upload: $(ARCHIVES) init
$(OPAM) upload -opam P3.opam -descr P3/README -archive P3.tar.gz -repo $(REPO)
cd packages && \
$(OPAM) upload -opam P4-1.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
- $(OPAM) update # update the list of available packages with the one being upadated
+ $(OPAM) update # update the list of available packages with the one being updated
list: upload
$(OPAM) list
@@ -66,7 +66,8 @@ upload-new: install
$(OPAM) upload -opam P4-2.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
cd packages && \
$(OPAM) upload -opam P4-3.opam -descr P4/README -archive P4.tar.gz -repo $(REPO)
- $(OPAM) update # update the list of available packages with the one being upadated
+ $(OPAM) update # update the list of available packages with the one being updated
+
upgrade: upload-new
$(OPAM) list
$(OPAM) upgrade

0 comments on commit f6f4b18

Please sign in to comment.