blob: 82e6567dc74245af4d2f365eb9564b054beca174 [file] [log] [blame]
Andrew Geisslerc182c622020-05-15 14:13:32 -05001From 1ed066fc6fa7d7afffe3545c4e3ea937529e6c49 Mon Sep 17 00:00:00 2001
2From: 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>
30---
31 lib/transaction.c | 13 ++++++++++++-
32 1 file changed, 12 insertions(+), 1 deletion(-)
33
Andrew Geissler87f5cff2022-09-30 13:13:31 -050034Index: git/lib/transaction.c
35===================================================================
36--- git.orig/lib/transaction.c
37+++ git/lib/transaction.c
38@@ -402,7 +402,18 @@ static int handleColorConflict(rpmts ts,
Andrew Geisslerc182c622020-05-15 14:13:32 -050039 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