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

Remove empty directories after component uninstall #634

Merged
merged 3 commits into from Aug 10, 2016

Conversation

inejge
Copy link
Contributor

@inejge inejge commented Aug 2, 2016

Re #596. I've placed the test in tests/cli-v2.rs, remove_target; there's an almost identical one, with the same name, in tests/cli-rustup.rs, which I haven't modified.

Edit: the code does the removal pass unconditionally, as opposed to the suggestion in the issue; however, I don't see how the situation where rustup is allowed to remove the component's files, but not directories, could arise. What am I overlooking?

@brson
Copy link
Contributor

brson commented Aug 6, 2016

@inejge thank you! Unfortunately it's the end of the day here and I'm tired. I'll try to review over the weekend.

The situation where the directory can't be removed is theoretical. The installation code is intended to be used not just in rustup but for Rust packages anywhere (e.g. the installers on the main website today are the same installation format and they install to the system). I don't feel too strongly about it.

* Fix whitespace (no tabs)
* Short-circuit the iterator on non-empty dir
* Avoid repetition in the part loop
@inejge
Copy link
Contributor Author

inejge commented Aug 7, 2016

Ah, OK. The code should then be usable as is. I've pushed another commit with fixes for a couple of nits I've noticed in the meantime.

@brson brson merged commit 1a5a407 into rust-lang:master Aug 10, 2016
@brson
Copy link
Contributor

brson commented Aug 10, 2016

Thanks @inejge!

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.

None yet

2 participants