Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo: remove temp directory instead of clean_dir #4197

Merged
merged 3 commits into from
Jun 11, 2020
Merged

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented May 12, 2020

supersede #4166, see discussions full there.

When removing temporary stuff, a directory cleaning is done, to remove all intermediate temporary directories. The process is upward: if directory is empty, removes it, and check its on parent, ... On some new containers, when cleaning a temporary repository (new repo mechanism) it reaches /tmp, as its only content was those opam repo temporary files.

Copy link
Member

@AltGr AltGr left a comment

Choose a reason for hiding this comment

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

Could have a tad documentation but the fix is OK.
A doc on the interface of OpamFilename.rmdir_cleanup explaining to be careful with use-cases would have been great too (esp. since you took the care to review the uses once!)

src/state/opamRepositoryState.ml Show resolved Hide resolved
…nt if empty

Two cases:
- repository loaded in TMPDIR, in the form TMP/opam-xxx/reponame: remove reponame and tmpdir (empty after removing the first)
- repository already present in opamroot, in the form OPAMROOT/repo/reponame: need to remove only reponame (repo in never empty)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants