From c1cd7909a4c5cce7423bd8b3ae5540f347cfd02f Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 30 Nov 2024 10:55:13 +0000 Subject: [PATCH 1/3] Add a test showing the behaviour of opam switch list-available with several arguments --- tests/reftests/switch-list-available.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/reftests/switch-list-available.test b/tests/reftests/switch-list-available.test index 0033974d6ed..bedc168df16 100644 --- a/tests/reftests/switch-list-available.test +++ b/tests/reftests/switch-list-available.test @@ -149,3 +149,7 @@ comp_c 1 # Name # Version # Synopsis comp_c 1 comp_c 2 +### : show the behaviour of list-available with several arguments +### opam switch list-available "comp-*" "comp_*" +# Listing available compilers from repositories: default +# No matches found From b7a41d15ea09acc2705de48ff0234b16143824d9 Mon Sep 17 00:00:00 2001 From: Kate Date: Sat, 30 Nov 2024 10:57:30 +0000 Subject: [PATCH 2/3] Fix opam switch list-available when given several arguments --- master_changes.md | 1 + src/client/opamCommands.ml | 4 ++-- tests/reftests/switch-list-available.test | 10 +++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/master_changes.md b/master_changes.md index 64d2b77cc2e..b877daed335 100644 --- a/master_changes.md +++ b/master_changes.md @@ -39,6 +39,7 @@ users) ## Switch * [BUG] Fix `opam switch remove ` failure when it is a linked switch [#6276 @btjorge - fix #6275] + * Fix `opam switch list-available` when given several arguments [#6318 @kit-ty-kate] ## Config diff --git a/src/client/opamCommands.ml b/src/client/opamCommands.ml index 1d1266926fe..83f15c3f1b4 100644 --- a/src/client/opamCommands.ml +++ b/src/client/opamCommands.ml @@ -2904,7 +2904,7 @@ let switch cli = in let all_compilers = OpamListCommand.filter ~base:compilers st - (OpamFormula.ands (List.map (fun f -> OpamFormula.Atom f) filters)) + (OpamFormula.ors (List.map (fun f -> OpamFormula.Atom f) filters)) in let compilers = if all then @@ -3199,7 +3199,7 @@ let pin_doc = "Pin a given package to a specific version or source." let pin ?(unpin_only=false) cli = let doc = pin_doc in let commands = [ - cli_original, "list", `list, [], + cli_original, "list", `list, [], "Lists pinned packages. \ If the source is a remote repository, \ displays the hash representing its state."; diff --git a/tests/reftests/switch-list-available.test b/tests/reftests/switch-list-available.test index bedc168df16..cd0860fe625 100644 --- a/tests/reftests/switch-list-available.test +++ b/tests/reftests/switch-list-available.test @@ -152,4 +152,12 @@ comp_c 2 ### : show the behaviour of list-available with several arguments ### opam switch list-available "comp-*" "comp_*" # Listing available compilers from repositories: default -# No matches found +# Name # Version # Synopsis +comp-a 1 +comp-b 1 +comp_c 1 +comp-a 2 +comp-a 3 +comp-a 4 +comp-b 4 +[NOTE] Some compilers have been hidden (e.g. pre-releases). If you want to display them, run: 'opam switch list-available --all' From 1e630237e02980d14a6228e6d426c4179fe960f7 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 2 Dec 2024 10:56:25 +0000 Subject: [PATCH 3/3] fixup --- master_changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_changes.md b/master_changes.md index b877daed335..e6b634630ea 100644 --- a/master_changes.md +++ b/master_changes.md @@ -39,7 +39,7 @@ users) ## Switch * [BUG] Fix `opam switch remove ` failure when it is a linked switch [#6276 @btjorge - fix #6275] - * Fix `opam switch list-available` when given several arguments [#6318 @kit-ty-kate] + * [BUG] Fix `opam switch list-available` when given several arguments [#6318 @kit-ty-kate] ## Config