How to address 'package already exists as a directory in system'?
Hi, I've maintaining the nvme-cli package and run into a problem and I can't figure out with my google-foo. The upstream version till 2.0-rc6 installed the bash completion script to /usr/share/bash-completion/completions/nvme/bash-nvme-completion.sh and with 2.0-rc7 the files lands in /usr/share/bash-completion/completions/nvme The spec files hasn't changed from rc6 to rc7 but I suspect it was wrong from the beginning as it doesn't list /bash-nvme-completion.sh %files bash-completion %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/nvme And with the this setup rpm complains during upgrading the bash completion package [1] with "File from package already exists as a directory in system" What is the recommended way to resolves this? Thanks, Daniel [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1197365
On Tuesday 2022-03-22 10:54, Daniel Wagner wrote:
Hi,
I've maintaining the nvme-cli package and run into a problem and I can't figure out with my google-foo.
The upstream version till 2.0-rc6 installed the bash completion script to
/usr/share/bash-completion/completions/nvme/bash-nvme-completion.sh
and with 2.0-rc7 the files lands in
/usr/share/bash-completion/completions/nvme
The spec files hasn't changed from rc6 to rc7 but I suspect it was wrong from the beginning as it doesn't list /bash-nvme-completion.sh
The %files section has no bearing. Changing a directory to a non-directory never works in rpm because doing so is not an atomic operation.
On Tue, Mar 22, 2022 at 11:01:51AM +0100, Jan Engelhardt wrote:
The spec files hasn't changed from rc6 to rc7 but I suspect it was wrong from the beginning as it doesn't list /bash-nvme-completion.sh
The %files section has no bearing. Changing a directory to a non-directory never works in rpm because doing so is not an atomic operation.
There is no workaround for this type of change?
On Tue, 2022-03-22 at 11:14 +0100, Daniel Wagner wrote:
On Tue, Mar 22, 2022 at 11:01:51AM +0100, Jan Engelhardt wrote:
The spec files hasn't changed from rc6 to rc7 but I suspect it was wrong from the beginning as it doesn't list /bash-nvme-completion.sh
The %files section has no bearing. Changing a directory to a non- directory never works in rpm because doing so is not an atomic operation.
There is no workaround for this type of change?
Maybe rename the file to %{_datadir}/bash-completion/completions/nvme-cli The directory "nvme" will be removed and if you really need to, you can the file back in a later update. If you do that, there'll always be some risk that people skip the intermediate update step and run into the same error that you had. Martin
On Tue, 2022-03-22 at 13:51 +0000, Martin Wilck wrote:
On Tue, 2022-03-22 at 11:14 +0100, Daniel Wagner wrote:
On Tue, Mar 22, 2022 at 11:01:51AM +0100, Jan Engelhardt wrote:
The spec files hasn't changed from rc6 to rc7 but I suspect it was wrong from the beginning as it doesn't list /bash-nvme-completion.sh
The %files section has no bearing. Changing a directory to a non- directory never works in rpm because doing so is not an atomic operation.
There is no workaround for this type of change?
Maybe rename the file to
%{_datadir}/bash-completion/completions/nvme-cli
The directory "nvme" will be removed and if you really need to, you can the file back in a later update. If you do that, there'll always be some risk that people skip the intermediate update step and run into the same error that you had.
Please no 'hoping that things work' We had plenty of such cases already and the common solution is a pre script in the form of (simplified) %pre if [ -d %{_datadir}/bash-completion/completions/nvme ]; then rm -rf %{_datadir}/bash-completion/completions/nvme fi This will eliminate the existing directory prior to installing the new package Cheers, Dominique
On Tue, Mar 22, 2022 at 02:58:13PM +0100, Dominique Leuenberger / DimStar wrote:
We had plenty of such cases already and the common solution is a pre script in the form of (simplified)
%pre if [ -d %{_datadir}/bash-completion/completions/nvme ]; then rm -rf %{_datadir}/bash-completion/completions/nvme fi
This will eliminate the existing directory prior to installing the new package
I got the same via bugzilla from Christophe Giboudeaux. The fix is queued. Thanks for the help!
participants (4)
-
Daniel Wagner
-
Dominique Leuenberger / DimStar
-
Jan Engelhardt
-
Martin Wilck