--- rpm-5.4.10/lib/rpmds.c~ 2012-07-06 17:39:16.000000000 +0200 +++ rpm-5.4.10/lib/rpmds.c 2012-09-13 12:40:32.439076460 +0200 @@ -4036,6 +4036,12 @@ assert((rpmdsFlags(A) & RPMSENSE_SENSEMASK) == A->ns.Flags); assert((rpmdsFlags(B) & RPMSENSE_SENSEMASK) == B->ns.Flags); + /* Different namespaces don't overlap. */ + if (A->ns.Type != B->ns.Type) { + result = 0; + goto exit; + } + /* Different names (and/or name.arch's) don't overlap. */ if (rpmdsNAcmp(A, B)) { result = 0; diff -ur rpm-5.4.10/lib/depends.c rpm-5.4.10.nstype/lib/depends.c --- rpm-5.4.10/lib/depends.c 2012-11-30 13:03:40.350619256 +0100 +++ rpm-5.4.10.nstype/lib/depends.c 2012-11-30 12:08:01.266204377 +0100 @@ -16,6 +16,7 @@ #define _RPMDB_INTERNAL /* XXX response cache needs dbiOpen et al. */ #include +#define _RPMDS_INTERNAL #define _RPMEVR_INTERNAL #include #include @@ -1570,6 +1579,7 @@ /*@null@*/ rpmds dirnames, /*@null@*/ rpmds linktos, /*@null@*/ const char * depName, + nsType depNS, rpmuint32_t tscolor, int adding) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ @@ -1579,6 +1589,7 @@ rpmps ps = rpmtsProblems(ts); rpmuint32_t dscolor; const char * Name; + nsType NSType; int terminate = 2; /* XXX terminate if rc >= terminate */ int rc; int ourrc = 0; @@ -1598,6 +1609,11 @@ if (depName != NULL && strcmp(depName, Name)) continue; + NSType = rpmdsNSType(requires); + + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) + continue; + /* Ignore colored requires not in our rainbow. */ dscolor = rpmdsColor(requires); if (tscolor && dscolor && !(tscolor & dscolor)) @@ -1639,6 +1659,11 @@ if (depName != NULL && strcmp(depName, Name)) continue; + NSType = rpmdsNSType(conflicts); + + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) + continue; + /* Ignore colored conflicts not in our rainbow. */ dscolor = rpmdsColor(conflicts); if (tscolor && dscolor && !(tscolor & dscolor)) @@ -1676,6 +1703,11 @@ if (depName != NULL && strcmp(depName, Name)) continue; + NSType = rpmdsNSType(dirnames); + + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) + continue; + /* Ignore colored dirnames not in our rainbow. */ dscolor = rpmdsColor(dirnames); if (tscolor && dscolor && !(tscolor & dscolor)) @@ -1724,6 +1758,11 @@ if (depName != NULL && strcmp(depName, Name)) continue; + NSType = rpmdsNSType(linktos); + + if (depNS != RPMNS_TYPE_UNKNOWN && depNS != NSType) + continue; + /* Ignore colored linktos not in our rainbow. */ dscolor = rpmdsColor(linktos); if (tscolor && dscolor && !(tscolor & dscolor)) @@ -1771,7 +1812,7 @@ * @param adding dependency is from added package set? * @return 0 no problems found */ -static int checkPackageSet(rpmts ts, const char * depName, +static int checkPackageSet(rpmts ts, const char * depName, nsType depNS, /*@only@*/ /*@null@*/ rpmmi mi, int adding) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, mi, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -1816,7 +1857,7 @@ rc = checkPackageDeps(ts, he->p.str, requires, conflicts, dirnames, linktos, - depName, tscolor, adding); + depName, depNS, tscolor, adding); (void)rpmdsFree(linktos); linktos = NULL; @@ -1844,7 +1886,7 @@ * @param depName requires name * @return 0 no problems found */ -static int checkDependentPackages(rpmts ts, const char * depName) +static int checkDependentPackages(rpmts ts, const char * depName, nsType depNS) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -1854,7 +1896,7 @@ if (rpmtsGetRdb(ts) != NULL) { rpmmi mi; mi = rpmtsInitIterator(ts, RPMTAG_REQUIRENAME, depName, 0); - rc = checkPackageSet(ts, depName, mi, 0); + rc = checkPackageSet(ts, depName, depNS, mi, 0); } return rc; } @@ -1865,7 +1908,7 @@ * @param depName conflicts name * @return 0 no problems found */ -static int checkDependentConflicts(rpmts ts, const char * depName) +static int checkDependentConflicts(rpmts ts, const char * depName, nsType depNS) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -1875,7 +1918,7 @@ if (rpmtsGetRdb(ts) != NULL) { rpmmi mi; mi = rpmtsInitIterator(ts, RPMTAG_CONFLICTNAME, depName, 0); - rc = checkPackageSet(ts, depName, mi, 1); + rc = checkPackageSet(ts, depName, depNS, mi, 1); } return rc; @@ -1939,7 +1985,7 @@ rc = checkPackageDeps(ts, rpmteNEVRA(p), requires, conflicts, dirnames, linktos, - NULL, tscolor, 1); + NULL, RPMNS_TYPE_UNKNOWN, tscolor, 1); if (rc && (ourrc = rc) >= terminate) break; @@ -1963,7 +2011,7 @@ #endif /* Adding: check provides key against conflicts matches. */ - if (checkDependentConflicts(ts, depName)) + if (checkDependentConflicts(ts, depName, rpmdsNSType(provides))) rc = 1; } if (rc && (ourrc = rc) >= terminate) @@ -1975,7 +2026,7 @@ depName = _free(depName); depName = xstrdup(rpmfiFN(fi)); /* Adding: check filename against conflicts matches. */ - if (checkDependentConflicts(ts, depName)) + if (checkDependentConflicts(ts, depName, RPMNS_TYPE_UNKNOWN)) rc = 1; } if (rc && (ourrc = rc) >= terminate) @@ -2006,7 +2058,7 @@ depName = xstrdup(rpmdsN(provides)); /* Erasing: check provides against requiredby matches. */ - if (checkDependentPackages(ts, depName)) + if (checkDependentPackages(ts, depName, rpmdsNSType(provides))) rc = 1; } if (rc && (ourrc = rc) >= terminate) @@ -2018,7 +2070,7 @@ depName = _free(depName); depName = xstrdup(rpmfiFN(fi)); /* Erasing: check filename against requiredby matches. */ - if (checkDependentPackages(ts, depName)) + if (checkDependentPackages(ts, depName, RPMNS_TYPE_UNKNOWN)) rc = 1; } if (rc && (ourrc = rc) >= terminate) @@ -2039,7 +2091,7 @@ const char * dep = NULL; int adding = 2; tscolor = 0; /* XXX no coloring for transaction dependencies. */ - rc = checkPackageDeps(ts, tsNEVRA, R, C, D, L, dep, tscolor, adding); + rc = checkPackageDeps(ts, tsNEVRA, R, C, D, L, dep, RPMNS_TYPE_UNKNOWN, tscolor, adding); } if (rc && (ourrc = rc) >= terminate) goto exit; diff -ur rpm-5.4.10/lib/rpmal.c rpm-5.4.10.nstype/lib/rpmal.c --- rpm-5.4.10/lib/rpmal.c 2012-04-15 23:20:57.000000000 +0200 +++ rpm-5.4.10.nstype/lib/rpmal.c 2012-11-30 12:57:52.579432191 +0100 @@ -61,6 +65,7 @@ alKey pkgKey; /*!< Containing package. */ /*@observer@*/ const char * entry; /*!< Dependency name. */ + nsType entryNS; /*!< Dependency namesapce. */ unsigned short entryLen; /*!< No. of bytes in name. */ unsigned short entryIx; /*!< Dependency index. */ indexEntryType_e type; /*!< Type of available item. */ @@ -271,6 +276,9 @@ if (lenchk) return lenchk; + if (a->entryNS != b->entryNS) + return -1; + return strcmp(a->entry, b->entry); } @@ -305,6 +313,7 @@ aie->pkgKey = pkgKey; /*@-assignexpose@*/ aie->entry = Name; + aie->entryNS = rpmdsNSType(provides); /*@=assignexpose@*/ aie->entryLen = (unsigned short)strlen(Name); ix = rpmdsIx(provides); @@ -421,6 +431,7 @@ memset(alloca(sizeof(*needle)), 0, sizeof(*needle)); /*@-assignexpose -temptrans@*/ needle->entry = KName; + needle->entryNS = rpmdsNSType(ds); /*@=assignexpose =temptrans@*/ needle->entryLen = (unsigned short)strlen(needle->entry);