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 folders when doing make uninstall #292

Open
gabrielebndn opened this issue Nov 25, 2019 · 2 comments
Open

Remove empty folders when doing make uninstall #292

gabrielebndn opened this issue Nov 25, 2019 · 2 comments

Comments

@gabrielebndn
Copy link
Contributor

When doing make uninstall only the files are removed, but the folders are left there, even if they are empty. This leaves the system with a lot of empty folders.
I think this should be changed and the empty folders should be removed. A test should be performed to check whether the folder is empty: if it is empty, it is silently removed; if it is not, a warning should be issued saying "cannot remove folder blah blah blah because it is not empty". This is analogous to what apt does.
Ideally, make install followed by make uninstall should leave the system in the exact same state as it was before

@jcarpent
Copy link
Contributor

You're partially right I would say. This indeed annoying to have remaining empty folders left when uninstalling applications. BUT, some applications (e.g. CppAD and CppADCodeGen) use the same installation folder (cppad) for the installation. In other words, we cannot remove some folders when some other applications are still in place.
Normally, the uninstallation of a package is taken in charge by the package manager (such as apt, brew, etc.), which does the job in your back.

@gabrielebndn
Copy link
Contributor Author

@jcarpent exactly. That is why I say make uninstall should check whether the folder is empty. If it is not, clearly it will be left there; but if it is not, I see no reason not to remove it. This is exactly what APT does. In other words, the workflow should be:

  • Remove installed files one by one
  • After removing all files from a given folder, check whether said folder is empty
  • If the folder is empty, remove the folder too
  • If it is not empty, issue a warning "cannot remove folder"

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

No branches or pull requests

2 participants