Fedora Linux Support Community & Resources Center
  #1  
Old 14th September 2017, 10:24 AM
ralberto Offline
Registered User
 
Join Date: Sep 2017
Location: Aveiro
Posts: 4
linuxfedorafirefox
Update RPM conflict

Hi all.
I've created an rpm and installed that rpm on my system without any problems. After that I've decided to create a new version of the same RPM. However, when updating I get a conflict during the update:

Transaction check error:
file /opt/automation/ffwk/inventory/discovery from install of ffwk-automation-1.1.0-r66.el7.noarch conflicts with file from package ffwk-automation-1.1.0-r47.xxx.el7.noarch


The conflict appears to be that the previous RPM distributed a directory called "/opt/automation/ffwk/inventory/discovery" and in the new version that directory has been removed and a file is distributed exactly in the same place, i.e.: /opt/automation/ffwk/inventory/discovery

Can't we replace a directory with a file with same name exactly on the same location? Am I missing something?

Any help would be appreciated.
Thanks.
Rui
Reply With Quote
  #2  
Old 14th September 2017, 04:16 PM
srakitnican Offline
Registered User
 
Join Date: Oct 2011
Posts: 1,540
linuxchrome
Re: Update RPM conflict

Is the older package version owning that directory?
Reply With Quote
  #3  
Old 15th September 2017, 11:27 AM
ralberto Offline
Registered User
 
Join Date: Sep 2017
Location: Aveiro
Posts: 4
linuxfedorafirefox
Re: Update RPM conflict

Yes.
directory /opt/automation/ffwk/inventory/discovery was created by the old package. Uninstalling the old package that directory is removed.
Reply With Quote
  #4  
Old 15th September 2017, 11:39 AM
ralberto Offline
Registered User
 
Join Date: Sep 2017
Location: Aveiro
Posts: 4
linuxfedorafirefox
Re: Update RPM conflict

I think yum rpm does not support replacing a directory with a file with the same name. Here's a striped demo of the "problem".

Code:
Name:     hello
Version:  2.10
Release:  1
Summary:  The "Hello World" program from GNU
License:  GPLv3+

%description
The "Hello World" program, done with all bells and whistles of a proper FOSS
project, including configuration, build, internationalization, help files, etc.


%install
mkdir -p %{buildroot}/opt/sample

%files
/opt/sample
Create the rpm and install.
After installing the rpm, create a new version... replacing the directory /opt/sample witrh a file.
Code:
Name:     hello
Version:  2.11
Release:  1
Summary:  The "Hello World" program from GNU
License:  GPLv3+
Source0: sample

%description
The "Hello World" program, done with all bells and whistles of a proper FOSS 
project, including configuration, build, internationalization, help files, etc.


%install
mkdir -p %{buildroot}/opt
cp %{SOURCE0} %{buildroot}/opt

%files
/opt/sample
Build the new version of the RPM and try to update the previously installed rpm and you'll get an error:
Error: Transaction check error:
file /opt/sample from install of hello-2.11-1.x86_64 conflicts with file from package hello-2.10-1.x86_64


Unless I'm missing something, what I'm trying to do does not work :-/

Thanks.
Rui
Reply With Quote
  #5  
Old 15th September 2017, 11:53 AM
srakitnican Offline
Registered User
 
Join Date: Oct 2011
Posts: 1,540
linuxchrome
Re: Update RPM conflict

I see what you mean, this seems to be a limitation to RPM. See https://fedoraproject.org/wiki/Packa...ry_Replacement for more info.

There is also a workaround included in previous link, following works:

Code:
Name:     directoryovewrite
Version:  2.11
Release:  1
Summary:  The "Hello World" program from GNU
License:  GPLv3+

%description
The "Hello World" program, done with all bells and whistles of a proper FOSS
project, including configuration, build, internationalization, help files, etc.


%install
mkdir -p %{buildroot}/opt
touch %{buildroot}/opt/sample

%pretrans -p <lua>
-- Define the path to directory being replaced below.
-- DO NOT add a trailing slash at the end.
path = "/opt/sample"
st = posix.stat(path)
if st and st.type == "directory" then
  status = os.rename(path, path .. ".rpmmoved")
  if not status then
    suffix = 0
    while not status do
      suffix = suffix + 1
      status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
    end
    os.rename(path, path .. ".rpmmoved")
  end
end

%files
/opt/sample
Reply With Quote
  #6  
Old 15th September 2017, 01:33 PM
ralberto Offline
Registered User
 
Join Date: Sep 2017
Location: Aveiro
Posts: 4
linuxfedorafirefox
Re: Update RPM conflict

Many thanks for the pointer.

Didn't know it was a documented limitation.
Reply With Quote
Reply

Tags
conflict, rpm, update

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
update conflict hadiono Using Fedora 2 15th September 2015 06:49 AM
Yum update conflict Hewjr100 F-20 Development Forum 4 30th September 2013 11:17 PM
Update Conflict superbnerd Using Fedora 14 16th September 2004 07:48 AM


Current GMT-time: 19:27 (Sunday, 24-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat