FS#25141 - Prevent certain directories from being removed when empty
Attached to Project:
Pacman
Opened by Florian Pritz (bluewind) - Saturday, 16 July 2011, 13:49 GMT
Last edited by Allan McRae (Allan) - Tuesday, 19 July 2011, 05:24 GMT
Opened by Florian Pritz (bluewind) - Saturday, 16 July 2011, 13:49 GMT
Last edited by Allan McRae (Allan) - Tuesday, 19 July 2011, 05:24 GMT
|
Details
Right now pacman always removes empty directories, but this
might lead to important directories being removed as
described here:
2 possible solutions: 1) An option in the package metadata which disables the empty directory check for the package . 2) A list of paths/directories (one per line) read from files in /etc/pacman.d/keep-dirs.d/ which shouldn't be removed when empty. |
This task depends upon
Closed by Allan McRae (Allan)
Tuesday, 19 July 2011, 05:24 GMT
Reason for closing: Fixed
Additional comments about closing: http://projects.archlinux.org/pacman.git /commit/?id=1c39e4fb
Tuesday, 19 July 2011, 05:24 GMT
Reason for closing: Fixed
Additional comments about closing: http://projects.archlinux.org/pacman.git /commit/?id=1c39e4fb
Let's KISS with option 2, we don't need a whole new format of config here- we have the Include framework, and we can just add a KeepDirs config variable if necessary.
However, how expensive/hard is it to just "do this right"? Psuedocode: if (file is directory) and (directory is empty) and (directory is unowned): remove, else keep
I don't see too much crazy here. The first check is super simple. The second is relatively easy (right now we just force an unlink and ignore errors, see related task). The third will take a bit of work and could potentially be "expensive", but I really don't think it would be all that bad.
Don't remove directories if any other installed package still contains them.
http://mailman.archlinux.org/pipermail/pacman-dev/2009-July/009012.html
I would say just do it, but don't forget the little benchmark.