Skip to content

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Jun 20, 2025

No description provided.

@rjbou rjbou added the PR: WIP Not for merge at this stage label Jun 20, 2025
@rjbou rjbou changed the title Enforce dry run not changin opam root Enforce dry run not changing opam root Jun 20, 2025
@rjbou
Copy link
Collaborator Author

rjbou commented Sep 4, 2025

I added several tests in the PR, all are fixed. I'm looking for other tests to add, even if they are not fixed in this PR.
Also i'm wondering if the PR needs a split, there is a lot of little fixes, but they can be grouped by topic (switch, pin, etc.). In all cases, the tests addition needs to contain all the cases.

match OpamStateConfig.(!r.dryrun), result with
| true, Result () ->
let base f = OpamFilename.Base.of_string (OpamFilename.Dir.to_string f) in
(match OpamRepositoryBackend.get_diff (OpamFilename.Dir.of_string "/") (base srcdir) (base srcdir0) with
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary hack, get_diff needs to change arguments and take absolute path, or have 2 functions.

let srcdir = OpamPath.Switch.pinned_package root st.switch nv.name in
let srcdir =
if OpamStateConfig.(!r.dryrun) then
OpamFilename.mk_tmp_dir ()
Copy link
Collaborator Author

@rjbou rjbou Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't check if all these temp dir created are well cleaned

### sh pre.sh
### OPAMVERBOSE=2 OPAMDEBUG=-5 opam switch remove dr --dry-run
### sh post.sh
### :2a: local switch creation :
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then numbers doesn't make sense, to update at finalisation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: WIP Not for merge at this stage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant