+++ This bug was initially created as a clone of Bug #1477214 +++ +++ This bug was initially created as a clone of Bug #1477196 +++ Description of problem: During transaction can be removed files from new packages, when new package contains symlink to directory, which contains files that corespond to files inside packages removed during transaction. Example: old rpm: /usr/share/dummy /usr/share/dummy/subdir /usr/share/dummy/subdir/dummy_file new rpm: /usr/share/dummy /usr/share/dummy/dummy_file /usr/share/dummy/subdir Where the last one is symlink: /usr/share/dummy/subdir -> . In that case the /usr/share/dummy/dummy_file file will be removed during removing of the old_rpm. How reproducible: always Steps to Reproduce: 1. # yum -y install the dummy-1.0-1.fc26.noarch.rpm rpm 2 # rpm --upgrade --replacefiles dummy-1.0-2.fc26.noarch.rpm 3. # rpm -V dummy - attached dummy rpms Actual results: 1. # yum -y install the dummy-1.0-1.fc26.noarch.rpm rpm 2 # rpm --upgrade --replacefiles dummy-1.0-2.fc26.noarch.rpm 3. # rpm -V dummy missing /usr/share/dummy/dummy_file Expected results: 1. # yum -y install the dummy-1.0-1.fc26.noarch.rpm rpm 2 # rpm --upgrade --replacefiles dummy-1.0-2.fc26.noarch.rpm 3. # rpm -V dummy (all files are installed correctly) Additional info: The new_rpm rpm contains %pre section, which removes the /usr/share/dummy/subdir directory in case that exists, so symlink can be created correctly. --- Additional comment from on 2017-08-01 14:54 CEST --- --- Additional comment from on 2017-08-01 14:55 CEST --- --- Additional comment from on 2017-08-01 14:56 CEST --- debug log from upgrade transaction.
Created attachment 1307586 [details] log debug log from upgrade transaction
Created attachment 1307589 [details] dummy-1.0-1.fc26.noarch.rpm
Created attachment 1307592 [details] dummy-1.0-2.fc26.noarch.rpm
Could you provide SRPMs as well please?
Created attachment 1308625 [details] dummy-1.0-1.fc26.src.rpm Here it is.
Created attachment 1308626 [details] dummy-1.0-2.fc26.src.rpm
So here's what I actually see: [root@sopuli Downloads]# rpm -Uvh dummy-1.0-1.fc26.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:dummy-1.0-1.fc26 ################################# [100%] [root@sopuli Downloads]# rpm -Uvh dummy-1.0-2.fc26.noarch.rpm Preparing... ################################# [100%] file /usr/share/dummy/subdir from install of dummy-1.0-2.fc26.noarch conflicts with file from package dummy-1.0-1.fc26.noarch [root@sopuli Downloads]# So rpm is telling you this is not going to work. Forcing the issue with --replacefiles means you get to keep all the pieces -> NOTABUG. Directory <-> symlink replacement cannot be done in %pre, you need to use %pretrans for that and then you dont need to force it. For testing purposes, it's sufficient to just replace the %pre in the dummy.spec with %pretrans. For real-world packages you'd need to use the embedded Lua interpreter. See https://fedoraproject.org/wiki/Packaging:Directory_Replacement