1 |
From b07982c2e495673f17cb68741b68d4ddddcf2688 Mon Sep 17 00:00:00 2001 |
2 |
From: unknown author <cooker@mandrivalinux.org> |
3 |
Date: Mon, 5 Jan 2009 13:29:57 +0000 |
4 |
Subject: [PATCH 08/35] no doc conflicts |
5 |
|
6 |
--- |
7 |
lib/transaction.c | 30 ++++++++++++++++++++++++++++++ |
8 |
1 files changed, 30 insertions(+), 0 deletions(-) |
9 |
|
10 |
diff --git a/lib/transaction.c b/lib/transaction.c |
11 |
index bf6f0e4..45eeaf3 100644 |
12 |
--- a/lib/transaction.c |
13 |
+++ b/lib/transaction.c |
14 |
@@ -56,6 +56,22 @@ static int sharedCmp(const void * one, const void * two) |
15 |
return 0; |
16 |
} |
17 |
|
18 |
+static int is_a_doc_conflict(rpmfi fi) |
19 |
+{ |
20 |
+ const char *ignorelist[] = { |
21 |
+ "/usr/share/man/", |
22 |
+ "/usr/share/gtk-doc/html/", |
23 |
+ "/usr/share/gnome/html/", |
24 |
+ NULL |
25 |
+ }; |
26 |
+ const char *fn = rpmfiFN(fi); |
27 |
+ const char **dnp; |
28 |
+ for (dnp = ignorelist; *dnp != NULL; dnp++) |
29 |
+ if (strstr(fn, *dnp) == fn) return 1; |
30 |
+ |
31 |
+ return 0; |
32 |
+} |
33 |
+ |
34 |
/** |
35 |
* handleInstInstalledFiles. |
36 |
* @param ts transaction set |
37 |
@@ -162,6 +178,13 @@ static int handleInstInstalledFiles(const rpmts ts, |
38 |
} |
39 |
} |
40 |
|
41 |
+ /* HACK: always install latest (arch-independent) man |
42 |
+ pages and gtk/gnome html doc files. */ |
43 |
+ if (rConflicts && is_a_doc_conflict(fi)) { |
44 |
+ fi->actions[fileNum] = FA_CREATE; |
45 |
+ rConflicts = 0; |
46 |
+ } |
47 |
+ |
48 |
if (rConflicts) { |
49 |
rpmpsAppend(ps, RPMPROB_FILE_CONFLICT, |
50 |
rpmteNEVRA(p), rpmteKey(p), |
51 |
@@ -518,6 +541,13 @@ assert(otherFi != NULL); |
52 |
done = 1; |
53 |
} |
54 |
|
55 |
+ /* HACK: always install latest (arch-independent) man |
56 |
+ pages and gtk/gnome html doc files. */ |
57 |
+ if (rConflicts && is_a_doc_conflict(fi)) { |
58 |
+ fi->actions[i] = FA_CREATE; |
59 |
+ rConflicts = 0; |
60 |
+ } |
61 |
+ |
62 |
if (rConflicts) { |
63 |
rpmpsAppend(ps, RPMPROB_NEW_FILE_CONFLICT, |
64 |
rpmteNEVRA(p), rpmteKey(p), |
65 |
-- |
66 |
1.6.1.3 |
67 |
|