Problem: Conflicts between two packages trying to install different versions
         of the same file are not detected. Both copies of the file are
         installed and the build is not deterministic because a different
         outcome results depending on which package is installed last.

Cause:   All conflicts are treated as color conflicts, even when the files
         are not ELF files. And one of the ways that these conflicts are
         handled is to install both conflicting files and letting the one
         installed last win.

Fix:     Backport from upstream (see function handleColorConflict in
         lib/transaction.c). Only treat as a color conflict when both of the
         conflicting files have a color and they do not both have the same
         color. Do not handle color conflicts by installing both conflicting
         files.

Signed-off-by: Martin Vuille <jpm...@yahoo.com>
---
 .../rpm-fix-failure-to-report-file-conflicts.patch | 24 ++++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.16.bb            |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 
meta/recipes-devtools/rpm/rpm/rpm-fix-failure-to-report-file-conflicts.patch

diff --git 
a/meta/recipes-devtools/rpm/rpm/rpm-fix-failure-to-report-file-conflicts.patch 
b/meta/recipes-devtools/rpm/rpm/rpm-fix-failure-to-report-file-conflicts.patch
new file mode 100644
index 0000000000..3f556ba97a
--- /dev/null
+++ 
b/meta/recipes-devtools/rpm/rpm/rpm-fix-failure-to-report-file-conflicts.patch
@@ -0,0 +1,24 @@
+--- a/lib/transaction.c
++++ b/lib/transaction.c
+@@ -411,7 +411,7 @@ assert(otherFi != NULL);
+ 
+               rConflicts = reportConflicts;
+               /* Resolve file conflicts to prefer Elf64 (if not forced) ... */
+-              if (tscolor != 0) {
++              if (tscolor != 0 && FColor != 0 && oFColor != 0 && FColor != 
oFColor) {
+                   if (FColor & prefcolor) {
+                       /* ... last file of preferred colour is installed ... */
+                       if (!iosmFileActionSkipped((iosmFileAction) 
fi->actions[i])) {
+@@ -431,12 +431,6 @@ assert(otherFi != NULL);
+                           otherFi->actions[otherFileNum] = FA_CREATE;
+                       fi->actions[i] = FA_SKIPCOLOR;
+                       rConflicts = 0;
+-                  } else
+-                  {
+-                      /* ... otherwise, do both, last in wins. */
+-                      otherFi->actions[otherFileNum] = FA_CREATE;
+-                      fi->actions[i] = FA_CREATE;
+-                      rConflicts = 0;
+                   }
+                   done = 1;
+               }
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb 
b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index 497af8e055..296f6b8a97 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -120,6 +120,7 @@ SRC_URI += " \
           file://0001-system.h-query.c-support-nosignature.patch \
           file://rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch \
           file://0001-macros-add-_gpg_sign_cmd_extra_args.patch \
+          file://rpm-fix-failure-to-report-file-conflicts.patch \
 "
 
 # OE specific changes
-- 
2.13.6

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to