From d2cd70c4a7057fe75361646599b6a08ecf80f61e Mon Sep 17 00:00:00 2001 From: unknown author <cooker@mandrivalinux.org> Date: Mon, 5 Jan 2009 13:29:57 +0000 Subject: [PATCH 08/36] no doc conflicts --- lib/transaction.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/lib/transaction.c b/lib/transaction.c index e4f282b..54eeb1e 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -262,6 +262,22 @@ static uint64_t countFiles(rpmts ts) return fc; } +static int is_a_doc_conflict(rpmfi fi) +{ + const char *ignorelist[] = { + "/usr/share/man/", + "/usr/share/gtk-doc/html/", + "/usr/share/gnome/html/", + NULL + }; + const char *fn = rpmfiFN(fi); + const char **dnp; + for (dnp = ignorelist; *dnp != NULL; dnp++) + if (strstr(fn, *dnp) == fn) return 1; + + return 0; +} + /** * handleInstInstalledFiles. * @param ts transaction set @@ -302,6 +318,13 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi, } } + /* HACK: always install latest (arch-independent) man + pages and gtk/gnome html doc files. */ + if (rConflicts && is_a_doc_conflict(fi)) { + rpmfsSetAction(fs, fx, FA_CREATE); + rConflicts = 0; + } + if (rConflicts) { char *altNEVR = headerGetAsString(otherHeader, RPMTAG_NEVRA); rpmps ps = rpmtsProblems(ts); @@ -481,6 +504,14 @@ assert(otherFi != NULL); } done = 1; } + + /* HACK: always install latest (arch-independent) man + pages and gtk/gnome html doc files. */ + if (rConflicts && is_a_doc_conflict(fi)) { + rpmfsSetAction(fs, i, FA_CREATE); + rConflicts = 0; + } + if (rConflicts) { rpmpsAppend(ps, RPMPROB_NEW_FILE_CONFLICT, rpmteNEVRA(p), rpmteKey(p), -- 1.6.4.4