[Rpm-maint] [rpm-software-management/rpm] File conflicts: Symlinked directories -> same file replaced by real directories -> unique files (#1458)

Mark Irish notifications at github.com
Thu Dec 10 18:18:40 UTC 2020


RPM Version: 4.13.1 (also recreated in 4.15.1)

Hi, my name is Mark Irish and I am on a team of developers that creates and distributes RPMs for open-source software on IBM i. In our distribution of RPM itself, we are trying to replace generic platform macros shared between all versions/releases of our system with release-specific macro files.

### The issue we are running into:

Previously, our `rpm.spec` handled platform macros by creating a symlink from every version/release to a common directory that stored the `macros` file. This meant that `.../rpm/platform/ppc-ibmi7.1/`, `.../rpm/platform/ppc-ibmi7.2/`, and `.../rpm/platform/ppc-ibmi7.3/` all were symlinked to `.../rpm/platform/ppc-ibmi`, and this latter directory held the `macros` file. That worked well, but now we want to enable release-specific flags in our macros.

However, when trying to replace the 3 macro "files" that were all the same (because they were symlinked to the same directory) with 3 different macro files in non-symlinked directories, the 2nd and 3rd file throw a `conflicts between attempted installs` error:

```
Transaction Check Error:
  file /QOpenSys/pkgs/lib/rpm-test/platform/ppc-ibmi7.2/macros conflicts between attempted installs of rpm-test-0.0.0-1.ppc64 and rpm-test-0.0.0-1.ppc64
  file /QOpenSys/pkgs/lib/rpm-test/platform/ppc-ibmi7.3/macros conflicts between attempted installs of rpm-test-0.0.0-1.ppc64 and rpm-test-0.0.0-1.ppc64
```

I don't believe this is an issue with symlinked directories. **We are aware that there is some lua magic that has to be done to convert symlinks to directories.** [We have followed the script here](https://fedoraproject.org/wiki/Packaging:Directory_Replacement#:~:text=Due%20to%20a%20known%20limitation,trying%20to%20install%20the%20package.), and it has fixed previous errors that we were encountering.

The issue seems to be RPM expecting any change to `.../rpm/platform/ppc-ibmi7.1/macros`, `.../rpm/platform/ppc-ibmi7.2/macros`, and `.../rpm/platform/ppc-ibmi7.3/macros` to be uniform: It doesn't complain about `7.1`, the first directory that changes to a new file, only about `7.2` and `7.3`. This also explains why the error notes of `conflicts between attempted installs of` the same version.

**I am able to provide 2 minimal spec files that recreate this issue.**

### The question:

Is this a bug in RPM? It seems possible that this is a strange edge case that wasn't considered, though the area of the code notes https://github.com/rpm-software-management/rpm/blob/4cbdd7c94071f52dfe64466df80e859193d89d89/lib/transaction.c#L628

Is there any RPM or lua magic that can be done to resolve these errors, similar to the lua script to resolve? Possibly create an intermediary release that somehow fixes the issue and allows the next release to replace the single `macros` file with multiple unique files?

I think a solution like `https://github.com/rpm-software-management/rpm/issues/1118` would work, but again that upgrade would have to be an intermediary step, as our issue is errors using RPM to upgrade RPM.

Thank you.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1458
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201210/dc3f051a/attachment-0001.html>


More information about the Rpm-maint mailing list