Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 1 | From 1ed066fc6fa7d7afffe3545c4e3ea937529e6c49 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 7 May 2020 17:40:58 +0800 |
| 4 | Subject: [PATCH] lib/transaction.c: fix file conflicts for MIPS64 N32 |
| 5 | |
| 6 | This patch is from: |
| 7 | https://github.com/rpm-software-management/rpm/issues/193 |
| 8 | |
| 9 | Error: Transaction check error: |
| 10 | file /sbin/ldconfig conflicts between attempted installs of |
| 11 | ldconfig-2.31+git0+71f2b249a2-r0.mips64_n32 and |
| 12 | lib32-ldconfig-2.31+git0+71f2b249a2-r0.mips32r2 |
| 13 | ... |
| 14 | |
| 15 | This was because: |
| 16 | transactions_color = 001 (ELF32) & 010 (ELF64) & 100 (ELF32 N32 MIPS64) |
| 17 | FColor = Current file color (001) & transaction_color (111) |
| 18 | oFcolor = Previous file color (100) & transaction_color (111) |
| 19 | |
| 20 | In handleColorConflict, it only deal with conditons "new preferred" or |
| 21 | "old preferred". But not deal with the situation where neither is the |
| 22 | preferred type. so for tri-lib system, like mips64/mips64 n32/mips(32), |
| 23 | "Transaction check error" occurred. |
| 24 | |
| 25 | Fixed by performing a 'last-in-wins' resolution when "neither is preferred". |
| 26 | |
| 27 | Upstream-Status: Submitted <https://github.com/rpm-software-management/rpm/issues/193> |
| 28 | |
| 29 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 30 | --- |
| 31 | lib/transaction.c | 13 ++++++++++++- |
| 32 | 1 file changed, 12 insertions(+), 1 deletion(-) |
| 33 | |
| 34 | diff --git a/lib/transaction.c b/lib/transaction.c |
| 35 | index 67b9db5..82386b8 100644 |
| 36 | --- a/lib/transaction.c |
| 37 | +++ b/lib/transaction.c |
| 38 | @@ -391,7 +391,18 @@ static int handleColorConflict(rpmts ts, |
| 39 | rpmfsSetAction(ofs, ofx, FA_CREATE); |
| 40 | rpmfsSetAction(fs, fx, FA_SKIPCOLOR); |
| 41 | rConflicts = 0; |
| 42 | - } |
| 43 | + }else { |
| 44 | + /* |
| 45 | + * If neither is already skipped, we skip the old one, and |
| 46 | + * install the new one (last in wins). |
| 47 | + */ |
| 48 | + if (ofs && !XFA_SKIPPING(rpmfsGetAction(ofs, ofx)) && |
| 49 | + fs && !XFA_SKIPPING(rpmfsGetAction(fs, fx))) { |
| 50 | + rpmfsSetAction(ofs, ofx, FA_SKIPCOLOR); |
| 51 | + rpmfsSetAction(fs, fx, FA_CREATE); |
| 52 | + } |
| 53 | + rConflicts = 0; |
| 54 | + } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | -- |
| 59 | 2.7.4 |
| 60 | |