Continue making transactionElement opaque.
CVS patchset: 5188 CVS date: 2001/11/17 00:52:45
This commit is contained in:
parent
c2b98f0e2c
commit
6a4d22da65
|
@ -248,7 +248,8 @@ static int removePackage(rpmTransactionSet ts, Header h, int dboffset,
|
|||
/*@=type =voidabstract @*/
|
||||
}
|
||||
|
||||
p = ts->order[ts->orderCount] = teNew(ts, h, NULL, NULL);
|
||||
p = teNew(ts, h, NULL, NULL);
|
||||
ts->order[ts->orderCount] = p;
|
||||
ts->orderCount++;
|
||||
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
|
@ -285,18 +286,18 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h,
|
|||
add = dsThis(h, RPMTAG_REQUIRENAME, (RPMSENSE_EQUAL|RPMSENSE_LESS));
|
||||
pkgKey = RPMAL_NOMATCH;
|
||||
for (pi = teInitIterator(ts), oc = 0; (p = teNextIterator(pi)) != NULL; oc++) {
|
||||
rpmDepSet this;
|
||||
|
||||
/* XXX Only added packages need be checked for dupes. */
|
||||
if (teGetType(p) == TR_REMOVED)
|
||||
continue;
|
||||
|
||||
/*@-type@*/
|
||||
rc = dsCompare(add, p->this);
|
||||
/*@=type@*/
|
||||
if ((this = teGetDS(p, RPMTAG_NAME)) == NULL)
|
||||
continue; /* XXX can't happen */
|
||||
|
||||
rc = dsCompare(add, this);
|
||||
if (rc != 0) {
|
||||
/*@-type@*/
|
||||
const char * pkgNEVR = dsiGetDNEVR(p->this);
|
||||
/*@=type@*/
|
||||
const char * pkgNEVR = dsiGetDNEVR(this);
|
||||
const char * addNEVR = dsiGetDNEVR(add);
|
||||
rpmMessage(RPMMESS_WARNING,
|
||||
_("package %s was already added, replacing with %s\n"),
|
||||
|
@ -326,7 +327,8 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h,
|
|||
/*@=type =voidabstract @*/
|
||||
}
|
||||
|
||||
p = ts->order[oc] = teNew(ts, h, key, relocs);
|
||||
p = teNew(ts, h, key, relocs);
|
||||
ts->order[oc] = p;
|
||||
if (!duplicate)
|
||||
ts->orderCount++;
|
||||
|
||||
|
@ -388,6 +390,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h,
|
|||
{ rpmdbMatchIterator mi;
|
||||
Header h2;
|
||||
|
||||
/* XXX FIXME: obsolete all packages with same provide, not just name. */
|
||||
mi = rpmtsInitIterator(ts, RPMTAG_NAME, name, 0);
|
||||
while((h2 = rpmdbNextIterator(mi)) != NULL) {
|
||||
/*@-branchstate@*/
|
||||
|
@ -413,9 +416,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h,
|
|||
mi = rpmdbFreeIterator(mi);
|
||||
}
|
||||
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
obsoletes = dsiInit(rpmdsLink(p->obsoletes, "Obsoletes"));
|
||||
/*@=type@*/
|
||||
obsoletes = dsiInit(rpmdsLink(teGetDS(p, RPMTAG_OBSOLETENAME), "Obsoletes"));
|
||||
if (obsoletes != NULL)
|
||||
while (dsiNext(obsoletes) >= 0) {
|
||||
const char * Name;
|
||||
|
@ -430,6 +431,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h,
|
|||
{ rpmdbMatchIterator mi;
|
||||
Header h2;
|
||||
|
||||
/* XXX FIXME: obsolete all packages with same provide, not just name. */
|
||||
mi = rpmtsInitIterator(ts, RPMTAG_NAME, Name, 0);
|
||||
|
||||
xx = rpmdbPruneIterator(mi,
|
||||
|
@ -745,7 +747,7 @@ static int checkPackageDeps(rpmTransactionSet ts, const char * pkgNEVR,
|
|||
continue; /* XXX can't happen */
|
||||
|
||||
/* Filter out requires that came along for the ride. */
|
||||
if (keyName && strcmp(keyName, Name))
|
||||
if (keyName != NULL && strcmp(keyName, Name))
|
||||
continue;
|
||||
|
||||
Flags = dsiGetFlags(requires);
|
||||
|
@ -942,13 +944,11 @@ static int ignoreDep(const transactionElement p,
|
|||
{
|
||||
struct badDeps_s * bdp = badDeps;
|
||||
|
||||
/*@-nullpass@*/ /* FIX: {p,q}->name may be NULL. */
|
||||
while (bdp->pname != NULL && bdp->qname != NULL) {
|
||||
if (!strcmp(teGetN(p), bdp->pname) && !strcmp(teGetN(q), bdp->qname))
|
||||
return 1;
|
||||
bdp++;
|
||||
}
|
||||
/*@=nullpass@*/
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -1297,10 +1297,7 @@ fprintf(stderr, "*** rpmdepOrder(%p) order %p[%d]\n", ts, ts->order, ts->orderCo
|
|||
/* XXX Only added packages are ordered (for now). */
|
||||
while ((p = teNext(pi, TR_ADDED)) != NULL) {
|
||||
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
requires = p->requires;
|
||||
/*@=type@*/
|
||||
if (requires == NULL)
|
||||
if ((requires = teGetDS(p, RPMTAG_REQUIRENAME)) == NULL)
|
||||
continue;
|
||||
|
||||
memset(selected, 0, sizeof(*selected) * ts->orderCount);
|
||||
|
@ -1510,9 +1507,8 @@ prtTSI(" p", teGetTSI(p));
|
|||
}
|
||||
|
||||
/* Find (and destroy if co-requisite) "q <- p" relation. */
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
requires = p->requires;
|
||||
/*@=type@*/
|
||||
if ((requires = teGetDS(p, RPMTAG_REQUIRENAME)) == NULL)
|
||||
continue; /* XXX can't happen */
|
||||
requires = dsiInit(requires);
|
||||
dp = zapRelation(q, p, requires, 1, &nzaps);
|
||||
|
||||
|
@ -1721,21 +1717,22 @@ int rpmdepCheck(rpmTransactionSet ts,
|
|||
|
||||
multiLib = teGetMultiLib(p);
|
||||
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
provides = p->provides;
|
||||
requires = p->requires;
|
||||
conflicts = p->conflicts;
|
||||
/*@=type@*/
|
||||
provides = teGetDS(p, RPMTAG_PROVIDENAME);
|
||||
requires = teGetDS(p, RPMTAG_REQUIRENAME);
|
||||
conflicts = teGetDS(p, RPMTAG_CONFLICTNAME);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "========== +++ %s\n" , teGetNEVR(p));
|
||||
rc = checkPackageDeps(ts, teGetNEVR(p), requires, conflicts,
|
||||
NULL, multiLib);
|
||||
if (rc)
|
||||
goto exit;
|
||||
|
||||
#ifdef DYING /* XXX all packages now have Provides: name = version-release */
|
||||
/* Adding: check name against conflicts matches. */
|
||||
rc = checkDependentConflicts(ts, teGetN(p));
|
||||
if (rc)
|
||||
goto exit;
|
||||
#endif
|
||||
|
||||
rc = 0;
|
||||
provides = dsiInit(provides);
|
||||
|
@ -1769,15 +1766,15 @@ int rpmdepCheck(rpmTransactionSet ts,
|
|||
|
||||
rpmMessage(RPMMESS_DEBUG, "========== --- %s\n" , teGetNEVR(p));
|
||||
|
||||
#ifdef DYING /* XXX all packages now have Provides: name = version-release */
|
||||
/* Erasing: check name against requiredby matches. */
|
||||
rc = checkDependentPackages(ts, teGetN(p));
|
||||
if (rc)
|
||||
goto exit;
|
||||
#endif
|
||||
|
||||
rc = 0;
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
provides = p->provides;
|
||||
/*@=type@*/
|
||||
provides = teGetDS(p, RPMTAG_PROVIDENAME);
|
||||
provides = dsiInit(provides);
|
||||
if (provides != NULL)
|
||||
while (dsiNext(provides) >= 0) {
|
||||
|
@ -1795,12 +1792,8 @@ int rpmdepCheck(rpmTransactionSet ts,
|
|||
if (rc)
|
||||
goto exit;
|
||||
|
||||
|
||||
|
||||
rc = 0;
|
||||
/*@-type@*/ /* FIX: transactionElement not opaque */
|
||||
fi = p->fi;
|
||||
/*@=type@*/
|
||||
fi = teGetFI(p, RPMTAG_BASENAMES);
|
||||
if ((fi = tfiInit(fi, 0)) != NULL)
|
||||
while (tfiNext(fi) >= 0) {
|
||||
const char * fn = tfiGetFN(fi);
|
||||
|
|
34
lib/rpmte.c
34
lib/rpmte.c
|
@ -225,6 +225,40 @@ fnpyKey teGetKey(transactionElement te)
|
|||
return (te != NULL ? te->key : NULL);
|
||||
}
|
||||
|
||||
rpmDepSet teGetDS(transactionElement te, rpmTag tag)
|
||||
{
|
||||
if (te == NULL)
|
||||
return NULL;
|
||||
|
||||
if (tag == RPMTAG_NAME)
|
||||
return te->this;
|
||||
else
|
||||
if (tag == RPMTAG_PROVIDENAME)
|
||||
return te->provides;
|
||||
else
|
||||
if (tag == RPMTAG_REQUIRENAME)
|
||||
return te->requires;
|
||||
else
|
||||
if (tag == RPMTAG_CONFLICTNAME)
|
||||
return te->conflicts;
|
||||
else
|
||||
if (tag == RPMTAG_OBSOLETENAME)
|
||||
return te->obsoletes;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TFI_t teGetFI(transactionElement te, rpmTag tag)
|
||||
{
|
||||
if (te == NULL)
|
||||
return NULL;
|
||||
|
||||
if (tag == RPMTAG_BASENAMES)
|
||||
return te->fi;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int teiGetOc(teIterator tei)
|
||||
{
|
||||
return tei->ocsave;
|
||||
|
|
18
lib/rpmte.h
18
lib/rpmte.h
|
@ -274,6 +274,24 @@ FD_t teGetFd(transactionElement te)
|
|||
fnpyKey teGetKey(transactionElement te)
|
||||
/*@*/;
|
||||
|
||||
/**
|
||||
* Retrieve dependency tag set from transaction element.
|
||||
* @param te transaction element
|
||||
* @param tag dependency tag
|
||||
* @return dependency tag set
|
||||
*/
|
||||
rpmDepSet teGetDS(transactionElement te, rpmTag tag)
|
||||
/*@*/;
|
||||
|
||||
/**
|
||||
* Retrieve file info tag set from transaction element.
|
||||
* @param te transaction element
|
||||
* @param tag file info tag
|
||||
* @return file info tag set
|
||||
*/
|
||||
TFI_t teGetFI(transactionElement te, rpmTag tag)
|
||||
/*@*/;
|
||||
|
||||
#if defined(_NEED_TEITERATOR)
|
||||
/**
|
||||
* Return transaction element index.
|
||||
|
|
32
po/rpm.pot
32
po/rpm.pot
|
@ -6,7 +6,7 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2001-11-16 18:03-0500\n"
|
||||
"POT-Creation-Date: 2001-11-16 19:26-0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -1415,45 +1415,45 @@ msgstr ""
|
|||
msgid "cannot open Packages database in %s\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:302
|
||||
#: lib/depends.c:303
|
||||
#, c-format
|
||||
msgid "package %s was already added, replacing with %s\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:584
|
||||
#: lib/depends.c:586
|
||||
msgid "(cached)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:609
|
||||
#: lib/depends.c:611
|
||||
msgid "(rpmrc provides)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:625
|
||||
#: lib/depends.c:627
|
||||
msgid "(rpmlib provides)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:646
|
||||
#: lib/depends.c:648
|
||||
msgid "(db files)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:658
|
||||
#: lib/depends.c:660
|
||||
msgid "(db provides)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:671
|
||||
#: lib/depends.c:673
|
||||
msgid "(db package)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:710
|
||||
#: lib/depends.c:712
|
||||
#, c-format
|
||||
msgid "%9s: (%s, %s) added to Depends cache.\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:712 lib/rpmds.c:407 lib/rpmds.c:566
|
||||
#: lib/depends.c:714 lib/rpmds.c:407 lib/rpmds.c:566
|
||||
msgid "NO "
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:712 lib/rpmds.c:407 lib/rpmds.c:566
|
||||
#: lib/depends.c:714 lib/rpmds.c:407 lib/rpmds.c:566
|
||||
msgid "YES"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1468,25 +1468,25 @@ msgid "========== recording tsort relations\n"
|
|||
msgstr ""
|
||||
|
||||
#. T4. Scan for zeroes.
|
||||
#: lib/depends.c:1371
|
||||
#: lib/depends.c:1368
|
||||
msgid ""
|
||||
"========== tsorting packages (order, #predecessors, #succesors, depth)\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:1448
|
||||
#: lib/depends.c:1445
|
||||
msgid "========== successors only (presentation order)\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:1508
|
||||
#: lib/depends.c:1505
|
||||
msgid "LOOP:\n"
|
||||
msgstr ""
|
||||
|
||||
#: lib/depends.c:1545
|
||||
#: lib/depends.c:1541
|
||||
msgid "========== continuing tsort ...\n"
|
||||
msgstr ""
|
||||
|
||||
#. Return no. of packages that could not be ordered.
|
||||
#: lib/depends.c:1550
|
||||
#: lib/depends.c:1546
|
||||
#, c-format
|
||||
msgid "rpmdepOrder failed, %d elements remain\n"
|
||||
msgstr ""
|
||||
|
|
Loading…
Reference in New Issue