From 99ebe32dcbca08bc86a490bed1b9b6973636c4f3 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Tue, 27 Oct 2015 11:56:33 +0900 Subject: [PATCH] Fix guessing pinning kind --- src/client/opamPinCommand.ml | 5 +++-- src/core/opamProcess.ml | 2 +- src/format/opamTypesBase.ml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/opamPinCommand.ml b/src/client/opamPinCommand.ml index fdefab5a999..14a4ac67d80 100644 --- a/src/client/opamPinCommand.ml +++ b/src/client/opamPinCommand.ml @@ -153,9 +153,10 @@ let update_config t name pins = OpamFile.Pinned.write pin_f pins let pin name ?version pin_option = - log "pin %a to %a" + log "pin %a to %a (%a)" (slog OpamPackage.Name.to_string) name - (slog string_of_pin_option) pin_option; + (slog string_of_pin_option) pin_option + (slog (string_of_pin_kind @* kind_of_pin_option)) pin_option; let t = OpamState.load_state "pin" OpamStateConfig.(!r.current_switch) in let pin_f = OpamPath.Switch.pinned t.root t.switch in let pin_kind = kind_of_pin_option pin_option in diff --git a/src/core/opamProcess.ml b/src/core/opamProcess.ml index 281254eda00..96614388041 100644 --- a/src/core/opamProcess.ml +++ b/src/core/opamProcess.ml @@ -535,7 +535,7 @@ let result_summary r = try Printf.sprintf " \"%s\"" (List.find - Re.(execp (compile (seq [ rep (diff any alpha); + Re.(execp (compile (seq [ bos; rep (diff any alpha); no_case (str "error") ]))) (List.rev es)) with Not_found -> "" diff --git a/src/format/opamTypesBase.ml b/src/format/opamTypesBase.ml index 76ee648d4ad..fc2d02d7664 100644 --- a/src/format/opamTypesBase.ml +++ b/src/format/opamTypesBase.ml @@ -71,7 +71,7 @@ let url_backend_of_pin_kind = function let looks_like_version_re = Re.(compile @@ - seq [digit; rep @@ diff any (set "/\\"); eos]) + seq [bos; digit; rep @@ diff any (set "/\\"); eos]) let pin_option_of_string ?kind ?(guess=false) s = match kind with