Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > c454047046288fa22cc04811dc0287e0 > files > 34

rpm-4.12.0.1-20.3.mga5.src.rpm

diff -u b/lib/transaction.c b/lib/transaction.c
--- b/lib/transaction.c
+++ b/lib/transaction.c	2012-06-08 16:25:39.367544735 +0000
@@ -374,6 +374,21 @@
     return rConflicts;
 }
 
+static int is_a_doc_conflict(const char *fn)
+{
+    const char *ignorelist[] = {
+       "/usr/share/man/",
+       "/usr/share/gtk-doc/html/",
+       "/usr/share/gnome/html/",
+       NULL
+    };
+    const char **dnp;
+    for (dnp = ignorelist; *dnp != NULL; dnp++)
+       if (strstr(fn, *dnp) == fn) return 1;
+
+    return 0;
+}
+
 /**
  * handleInstInstalledFiles.
  * @param ts		transaction set
@@ -427,9 +442,19 @@
 	if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEOLDFILES)
 	    rConflicts = 0;
 
+	char *fn;
+	if (rConflicts)
+	    fn = rpmfilesFN(fi, fx);
+	/* HACK: always install latest (arch-independent) man
+	   pages and gtk/gnome html doc files. */
+	if (rConflicts && is_a_doc_conflict(fn)) {
+	    rpmfsSetAction(fs, fx, FA_CREATE);
+	    rConflicts = 0;
+	    free(fn);
+	}
+
 	if (rConflicts) {
 	    char *altNEVR = headerGetAsString(otherHeader, RPMTAG_NEVRA);
-	    char *fn = rpmfilesFN(fi, fx);
 	    rpmteAddProblem(p, RPMPROB_FILE_CONFLICT, altNEVR, fn,
 			    headerGetInstance(otherHeader));
 	    free(fn);
@@ -571,8 +596,18 @@
 		rConflicts = handleColorConflict(ts, fs, fi, i,
 						otherFs, otherFi, otherFileNum);
 
+		char *fn;
+		if (rConflicts)
+		    fn = rpmfilesFN(fi, i);
+		/* HACK: always install latest (arch-independent) man
+		   pages and gtk/gnome html doc files. */
+		if (rConflicts && is_a_doc_conflict(fn)) {
+		    rpmfsSetAction(fs, i, FA_CREATE);
+		    rConflicts = 0;
+		    free(fn);
+		}
+
 		if (rConflicts && reportConflicts) {
-		    char *fn = rpmfilesFN(fi, i);
 		    rpmteAddProblem(p, RPMPROB_NEW_FILE_CONFLICT,
 				    rpmteNEVRA(otherTe), fn, 0);
 		    free(fn);