[pacman-dev] Do we need the force option?
So... I was looking through the bug tracker and I noticed this: https://bugs.archlinux.org/task/30179#comment105772 Essentially, directory on filesystem being replaced by a file. pacman ignores the conflict and then sees it is trying to replace a directory with a file and aborts. The choices are: 1) we modify force to delete the directory before installing the file - this can screw over the local db if the directory is owned. 2) we look at the conflicts and stop the transaction in non-file-to-file conflicts even with --force I think #2 is the better option here. OR... 3) get rid of --force altogether! I have good feelings about #3. When do we actually NEED --force? In most cases a simple rm will fix the conflict and it forces (pun!) the user to think about what is being done. There is only one case I can think of where that is not appropriate - when a user is trying to recover from deleting their local pacman database. But then they can use --dbonly to get the initial fix done, and will need to -Qk and rm etc as necessary... Would anyone object to removing the option completely? Allan
On 09/02/13 20:27, Allan McRae wrote:
So... I was looking through the bug tracker and I noticed this: https://bugs.archlinux.org/task/30179#comment105772
Essentially, directory on filesystem being replaced by a file. pacman ignores the conflict
... when using --force ...
and then sees it is trying to replace a directory with a file and aborts.
The choices are: 1) we modify force to delete the directory before installing the file - this can screw over the local db if the directory is owned. 2) we look at the conflicts and stop the transaction in non-file-to-file conflicts even with --force
I think #2 is the better option here.
OR...
3) get rid of --force altogether!
I have good feelings about #3. When do we actually NEED --force? In most cases a simple rm will fix the conflict and it forces (pun!) the user to think about what is being done.
There is only one case I can think of where that is not appropriate - when a user is trying to recover from deleting their local pacman database. But then they can use --dbonly to get the initial fix done, and will need to -Qk and rm etc as necessary...
Would anyone object to removing the option completely?
Allan
On 09.02.2013 11:27, Allan McRae wrote:
3) get rid of --force altogether!
I have good feelings about #3. When do we actually NEED --force? In most cases a simple rm will fix the conflict and it forces (pun!) the user to think about what is being done.
There is only one case I can think of where that is not appropriate - when a user is trying to recover from deleting their local pacman database. But then they can use --dbonly to get the initial fix done, and will need to -Qk and rm etc as necessary...
This sounds like a good idea. A deprecation message would be needed for some time and the man page should be updated to point the users wanting to fix their database entries to your aforementioned procedure. Speaking of this: is there a place where procedures like this are collected already? The variety of pacman options tend to be a tad overwhelming for the uninitiated ;) I haven't had need of --force except for some wild upgrade instructions of glibc or something along those lines. As a user, I think --force can be removed. Greetings, Christoph
On 02/09/2013 11:36 AM, Christoph Vigano wrote:
On 09.02.2013 11:27, Allan McRae wrote:
3) get rid of --force altogether!
I have good feelings about #3. When do we actually NEED --force? In most cases a simple rm will fix the conflict and it forces (pun!) the user to think about what is being done.
There is only one case I can think of where that is not appropriate - when a user is trying to recover from deleting their local pacman database. But then they can use --dbonly to get the initial fix done, and will need to -Qk and rm etc as necessary...
I'm not too happy about this to be honest. I've often had cases in which disk failures / crashes during updates / other causes left me with packages that did not own any of their files. Removing those one-by-one would be extremely tedious. Not only that, but removing them manually before re-installation means these files are inaccessible for a much longer time than when using --force. My favorite option is #2. And if #3 is chosen, consider providing the conflicting file lists in a form that can be passed to rm (while still keeping information about which package causes the conflict).
On 09/02/13 20:52, Jakob Gruber wrote:
I'm not too happy about this to be honest. I've often had cases in which disk failures / crashes during updates / other causes left me with packages that did not own any of their files. Removing those one-by-one would be extremely tedious.
pacman -S --dbonly pkg && pacman -S pkg The final one might not be needed, but better safe...
On 2013-02-09 11:57, Allan McRae wrote:
On 09/02/13 20:52, Jakob Gruber wrote:
I'm not too happy about this to be honest. I've often had cases in which disk failures / crashes during updates / other causes left me with packages that did not own any of their files. Removing those one-by-one would be extremely tedious.
pacman -S --dbonly pkg && pacman -S pkg
The final one might not be needed, but better safe...
I'd also lend my voice to remove the option. Following the BBS and the IRC, it seems this almost always causes more harm than good. And even though almost every case of its causing a problem is user error, if there's not really much benefit from keeping the option, then it seems sensible to remove it. All the best, Sam
participants (4)
-
Allan McRae
-
Christoph Vigano
-
halosghost@archlinux.info
-
Jakob Gruber