]>
Commit | Line | Data |
---|---|---|
e3f16e1b JR |
1 | --- rpm-5.4.10/lib/rpmds.c~ 2012-07-06 17:39:16.000000000 +0200 |
2 | +++ rpm-5.4.10/lib/rpmds.c 2012-09-13 12:40:32.439076460 +0200 | |
3 | @@ -4036,6 +4036,12 @@ | |
4 | ||
5 | assert((rpmdsFlags(A) & RPMSENSE_SENSEMASK) == A->ns.Flags); | |
6 | assert((rpmdsFlags(B) & RPMSENSE_SENSEMASK) == B->ns.Flags); | |
7 | + /* Different namespaces don't overlap. */ | |
8 | + if (A->ns.Type != B->ns.Type) { | |
9 | + result = 0; | |
10 | + goto exit; | |
11 | + } | |
12 | + | |
13 | /* Different names (and/or name.arch's) don't overlap. */ | |
14 | if (rpmdsNAcmp(A, B)) { | |
15 | result = 0; | |
d2ec8f01 JR |
16 | diff -ur rpm-5.4.10/lib/depends.c rpm-5.4.10.nstype/lib/depends.c |
17 | --- rpm-5.4.10/lib/depends.c 2012-11-30 13:03:40.350619256 +0100 | |
18 | +++ rpm-5.4.10.nstype/lib/depends.c 2012-11-30 12:08:01.266204377 +0100 | |
19 | @@ -16,6 +16,7 @@ | |
20 | #define _RPMDB_INTERNAL /* XXX response cache needs dbiOpen et al. */ | |
21 | #include <rpmdb.h> | |
22 | ||
23 | +#define _RPMDS_INTERNAL | |
24 | #define _RPMEVR_INTERNAL | |
25 | #include <rpmds.h> | |
26 | #include <rpmfi.h> | |
27 | @@ -1570,6 +1579,7 @@ | |
28 | /*@null@*/ rpmds dirnames, | |
29 | /*@null@*/ rpmds linktos, | |
30 | /*@null@*/ const char * depName, | |
31 | + nsType depNS, | |
32 | rpmuint32_t tscolor, int adding) | |
33 | /*@globals rpmGlobalMacroContext, h_errno, | |
34 | fileSystem, internalState @*/ | |
35 | @@ -1579,6 +1589,7 @@ | |
36 | rpmps ps = rpmtsProblems(ts); | |
37 | rpmuint32_t dscolor; | |
38 | const char * Name; | |
39 | + nsType NSType; | |
40 | int terminate = 2; /* XXX terminate if rc >= terminate */ | |
41 | int rc; | |
42 | int ourrc = 0; | |
43 | @@ -1598,6 +1609,11 @@ | |
44 | if (depName != NULL && strcmp(depName, Name)) | |
45 | continue; | |
46 | ||
47 | + NSType = rpmdsNSType(requires); | |
48 | + | |
49 | + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) | |
50 | + continue; | |
51 | + | |
52 | /* Ignore colored requires not in our rainbow. */ | |
53 | dscolor = rpmdsColor(requires); | |
54 | if (tscolor && dscolor && !(tscolor & dscolor)) | |
55 | @@ -1639,6 +1659,11 @@ | |
56 | if (depName != NULL && strcmp(depName, Name)) | |
57 | continue; | |
58 | ||
59 | + NSType = rpmdsNSType(conflicts); | |
60 | + | |
61 | + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) | |
62 | + continue; | |
63 | + | |
64 | /* Ignore colored conflicts not in our rainbow. */ | |
65 | dscolor = rpmdsColor(conflicts); | |
66 | if (tscolor && dscolor && !(tscolor & dscolor)) | |
67 | @@ -1676,6 +1703,11 @@ | |
68 | if (depName != NULL && strcmp(depName, Name)) | |
69 | continue; | |
70 | ||
71 | + NSType = rpmdsNSType(dirnames); | |
72 | + | |
73 | + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) | |
74 | + continue; | |
75 | + | |
76 | /* Ignore colored dirnames not in our rainbow. */ | |
77 | dscolor = rpmdsColor(dirnames); | |
78 | if (tscolor && dscolor && !(tscolor & dscolor)) | |
79 | @@ -1724,6 +1758,11 @@ | |
80 | if (depName != NULL && strcmp(depName, Name)) | |
81 | continue; | |
82 | ||
83 | + NSType = rpmdsNSType(linktos); | |
84 | + | |
85 | + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) | |
86 | + continue; | |
87 | + | |
88 | /* Ignore colored linktos not in our rainbow. */ | |
89 | dscolor = rpmdsColor(linktos); | |
90 | if (tscolor && dscolor && !(tscolor & dscolor)) | |
91 | @@ -1771,7 +1812,7 @@ | |
92 | * @param adding dependency is from added package set? | |
93 | * @return 0 no problems found | |
94 | */ | |
95 | -static int checkPackageSet(rpmts ts, const char * depName, | |
96 | +static int checkPackageSet(rpmts ts, const char * depName, nsType depNS, | |
97 | /*@only@*/ /*@null@*/ rpmmi mi, int adding) | |
98 | /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ | |
99 | /*@modifies ts, mi, rpmGlobalMacroContext, fileSystem, internalState @*/ | |
100 | @@ -1816,7 +1857,7 @@ | |
101 | ||
102 | rc = checkPackageDeps(ts, he->p.str, | |
103 | requires, conflicts, dirnames, linktos, | |
104 | - depName, tscolor, adding); | |
105 | + depName, depNS, tscolor, adding); | |
106 | ||
107 | (void)rpmdsFree(linktos); | |
108 | linktos = NULL; | |
109 | @@ -1844,7 +1886,7 @@ | |
110 | * @param depName requires name | |
111 | * @return 0 no problems found | |
112 | */ | |
113 | -static int checkDependentPackages(rpmts ts, const char * depName) | |
114 | +static int checkDependentPackages(rpmts ts, const char * depName, nsType depNS) | |
115 | /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ | |
116 | /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ | |
117 | { | |
118 | @@ -1854,7 +1896,7 @@ | |
119 | if (rpmtsGetRdb(ts) != NULL) { | |
120 | rpmmi mi; | |
121 | mi = rpmtsInitIterator(ts, RPMTAG_REQUIRENAME, depName, 0); | |
122 | - rc = checkPackageSet(ts, depName, mi, 0); | |
123 | + rc = checkPackageSet(ts, depName, depNS, mi, 0); | |
124 | } | |
125 | return rc; | |
126 | } | |
127 | @@ -1865,7 +1908,7 @@ | |
128 | * @param depName conflicts name | |
129 | * @return 0 no problems found | |
130 | */ | |
131 | -static int checkDependentConflicts(rpmts ts, const char * depName) | |
132 | +static int checkDependentConflicts(rpmts ts, const char * depName, nsType depNS) | |
133 | /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ | |
134 | /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ | |
135 | { | |
136 | @@ -1875,7 +1918,7 @@ | |
137 | if (rpmtsGetRdb(ts) != NULL) { | |
138 | rpmmi mi; | |
139 | mi = rpmtsInitIterator(ts, RPMTAG_CONFLICTNAME, depName, 0); | |
140 | - rc = checkPackageSet(ts, depName, mi, 1); | |
141 | + rc = checkPackageSet(ts, depName, depNS, mi, 1); | |
142 | } | |
143 | ||
144 | return rc; | |
145 | @@ -1939,7 +1985,7 @@ | |
146 | ||
147 | rc = checkPackageDeps(ts, rpmteNEVRA(p), | |
148 | requires, conflicts, dirnames, linktos, | |
149 | - NULL, tscolor, 1); | |
150 | + NULL, RPMNS_TYPE_UNKNOWN, tscolor, 1); | |
151 | if (rc && (ourrc = rc) >= terminate) | |
152 | break; | |
153 | ||
154 | @@ -1963,7 +2011,7 @@ | |
155 | #endif | |
156 | ||
157 | /* Adding: check provides key against conflicts matches. */ | |
158 | - if (checkDependentConflicts(ts, depName)) | |
159 | + if (checkDependentConflicts(ts, depName, rpmdsNSType(provides))) | |
160 | rc = 1; | |
161 | } | |
162 | if (rc && (ourrc = rc) >= terminate) | |
163 | @@ -1975,7 +2026,7 @@ | |
164 | depName = _free(depName); | |
165 | depName = xstrdup(rpmfiFN(fi)); | |
166 | /* Adding: check filename against conflicts matches. */ | |
167 | - if (checkDependentConflicts(ts, depName)) | |
168 | + if (checkDependentConflicts(ts, depName, RPMNS_TYPE_UNKNOWN)) | |
169 | rc = 1; | |
170 | } | |
171 | if (rc && (ourrc = rc) >= terminate) | |
172 | @@ -2006,7 +2058,7 @@ | |
173 | depName = xstrdup(rpmdsN(provides)); | |
174 | ||
175 | /* Erasing: check provides against requiredby matches. */ | |
176 | - if (checkDependentPackages(ts, depName)) | |
177 | + if (checkDependentPackages(ts, depName, rpmdsNSType(provides))) | |
178 | rc = 1; | |
179 | } | |
180 | if (rc && (ourrc = rc) >= terminate) | |
181 | @@ -2018,7 +2070,7 @@ | |
182 | depName = _free(depName); | |
183 | depName = xstrdup(rpmfiFN(fi)); | |
184 | /* Erasing: check filename against requiredby matches. */ | |
185 | - if (checkDependentPackages(ts, depName)) | |
186 | + if (checkDependentPackages(ts, depName, RPMNS_TYPE_UNKNOWN)) | |
187 | rc = 1; | |
188 | } | |
189 | if (rc && (ourrc = rc) >= terminate) | |
190 | @@ -2039,7 +2091,7 @@ | |
191 | const char * dep = NULL; | |
192 | int adding = 2; | |
193 | tscolor = 0; /* XXX no coloring for transaction dependencies. */ | |
194 | - rc = checkPackageDeps(ts, tsNEVRA, R, C, D, L, dep, tscolor, adding); | |
195 | + rc = checkPackageDeps(ts, tsNEVRA, R, C, D, L, dep, RPMNS_TYPE_UNKNOWN, tscolor, adding); | |
196 | } | |
197 | if (rc && (ourrc = rc) >= terminate) | |
198 | goto exit; |