Skip to content

Commit

Permalink
Fix guessing pinning kind
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Oct 27, 2015
1 parent fdd0e73 commit 99ebe32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/client/opamPinCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/opamProcess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> ""
Expand Down
2 changes: 1 addition & 1 deletion src/format/opamTypesBase.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99ebe32

Please sign in to comment.