Skip to content

Commit

Permalink
Allow to parse opam 2.1 switch import files containing extra-files
Browse files Browse the repository at this point in the history
opam 2.1 used the Base64 module from extlib which does not seem to pad encoded outputs.
In contrast, opam 2.2 uses the Base64 module from the base64 library
(after extlib's Base64 module was removed in extlib.1.7.8) which by default pads outputs
and requires padded inputs when decoding them
  • Loading branch information
kit-ty-kate committed May 2, 2024
1 parent c8366f7 commit ff22019
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ users)
## Remove

## Switch
* Allow to parse opam 2.1 switch import files containing extra-files [#5943 @kit-ty-kate - fix #5941]

## Config

Expand Down
2 changes: 1 addition & 1 deletion src/client/opamSwitchCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ let import_t ?ask importfile t =
OpamPath.Switch.extra_files_dir t.switch_global.root t.switch
in
OpamHash.Map.iter (fun hash content ->
let value = Base64.decode_exn content in
let value = Base64.decode_exn ~pad:false content in
let my = OpamHash.compute_from_string ~kind:(OpamHash.kind hash) value in
if OpamHash.contents my = OpamHash.contents hash then
let dst =
Expand Down

0 comments on commit ff22019

Please sign in to comment.