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