FS#40779 - Provide a way for a package to claim unowned files

Attached to Project: Pacman
Opened by Allan McRae (Allan) - Tuesday, 10 June 2014, 04:17 GMT
Task Type Bug Report
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 4.1.2
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No

Details

A common packaging issue is having a file added to a package that was previously created by an install script or during running of a package. This causes a conflict which requires manual intervention. It would be good to provide a way for a package to claim these files to avoid this.

e.g.
claimfiles=(usr/lib/foo/foo.pyc)
This task depends upon

Comment by Florian Pritz (bluewind) - Tuesday, 09 September 2014, 13:51 GMT
Random thoughts:
I'd suggest either adding some option like -D --add-file which can/should be called by a pre-conflict-check hook (requires hook support) or if there is lua hook support exposing some function that allows to change the transaction so the conflicting file is added to the old package.

A simple value in the pkgbuild is bad because it can't do any detection if the file is of a certain type (like a symlink) and it can't make sure the command is only run if the old package was a certain version (vercmp).
Comment by Allan McRae (Allan) - Tuesday, 09 September 2014, 22:20 GMT
Two points:
1) A value in the PKGBUILD would just be used if a conflict is detected for that file and the file is unowned. So it does not depend on package version at all. I do not understand your point about file type (or even how you are providing that information to pacman, or the package version, with -D --add-file).

2) I am not sure any hook could be run before conflict checking - running a hook and then aborting the transaction due to a conflict could leave a system in an unusable state.

Loading...