8 #define _RPMDS_INTERNAL
14 * Enable noisy range comparison debugging message?
16 static int _noisy_range_comparison_debug_message = 0;
20 int _rpmds_nopromote = 1;
22 int _rpmds_unspecified_epoch_noise = 0;
24 rpmds XrpmdsUnlink(rpmds ds, const char * msg, const char * fn, unsigned ln)
26 if (ds == NULL) return NULL;
27 if (_rpmds_debug && msg != NULL)
28 fprintf(stderr, "--> ds %p -- %d %s at %s:%u\n", ds, ds->nrefs, msg, fn, ln);
33 rpmds XrpmdsLink(rpmds ds, const char * msg, const char * fn, unsigned ln)
35 if (ds == NULL) return NULL;
38 if (_rpmds_debug && msg != NULL)
39 fprintf(stderr, "--> ds %p ++ %d %s at %s:%u\n", ds, ds->nrefs, msg, fn, ln);
44 rpmds rpmdsFree(rpmds ds)
46 HFD_t hfd = headerFreeData;
53 return rpmdsUnlink(ds, ds->Type);
56 fprintf(stderr, "*** ds %p\t%s[%d]\n", ds, ds->Type, ds->Count);
58 if (ds->tagN == RPMTAG_PROVIDENAME) {
59 tagEVR = RPMTAG_PROVIDEVERSION;
60 tagF = RPMTAG_PROVIDEFLAGS;
62 if (ds->tagN == RPMTAG_REQUIRENAME) {
63 tagEVR = RPMTAG_REQUIREVERSION;
64 tagF = RPMTAG_REQUIREFLAGS;
66 if (ds->tagN == RPMTAG_CONFLICTNAME) {
67 tagEVR = RPMTAG_CONFLICTVERSION;
68 tagF = RPMTAG_CONFLICTFLAGS;
70 if (ds->tagN == RPMTAG_OBSOLETENAME) {
71 tagEVR = RPMTAG_OBSOLETEVERSION;
72 tagF = RPMTAG_OBSOLETEFLAGS;
74 if (ds->tagN == RPMTAG_TRIGGERNAME) {
75 tagEVR = RPMTAG_TRIGGERVERSION;
76 tagF = RPMTAG_TRIGGERFLAGS;
81 ds->N = hfd(ds->N, ds->Nt);
82 ds->EVR = hfd(ds->EVR, ds->EVRt);
83 ds->Flags = (ds->h != NULL ? hfd(ds->Flags, ds->Ft) : _free(ds->Flags));
84 ds->h = headerFree(ds->h);
87 ds->DNEVR = _free(ds->DNEVR);
88 ds->Color = _free(ds->Color);
89 ds->Refs = _free(ds->Refs);
91 (void) rpmdsUnlink(ds, ds->Type);
92 memset(ds, 0, sizeof(*ds)); /* XXX trash and burn */
97 rpmds rpmdsNew(Header h, rpmTag tagN, int flags)
99 int scareMem = (flags & 0x1);
101 (scareMem ? (HGE_t) headerGetEntryMinMemory : (HGE_t) headerGetEntry);
102 rpmTag tagBT = RPMTAG_BUILDTIME;
112 if (tagN == RPMTAG_PROVIDENAME) {
114 tagEVR = RPMTAG_PROVIDEVERSION;
115 tagF = RPMTAG_PROVIDEFLAGS;
117 if (tagN == RPMTAG_REQUIRENAME) {
119 tagEVR = RPMTAG_REQUIREVERSION;
120 tagF = RPMTAG_REQUIREFLAGS;
122 if (tagN == RPMTAG_CONFLICTNAME) {
124 tagEVR = RPMTAG_CONFLICTVERSION;
125 tagF = RPMTAG_CONFLICTFLAGS;
127 if (tagN == RPMTAG_OBSOLETENAME) {
129 tagEVR = RPMTAG_OBSOLETEVERSION;
130 tagF = RPMTAG_OBSOLETEFLAGS;
132 if (tagN == RPMTAG_TRIGGERNAME) {
134 tagEVR = RPMTAG_TRIGGERVERSION;
135 tagF = RPMTAG_TRIGGERFLAGS;
139 if (hge(h, tagN, &Nt, (void **) &N, &Count)
140 && N != NULL && Count > 0)
144 ds = xcalloc(1, sizeof(*ds));
146 ds->h = (scareMem ? headerLink(h) : NULL);
153 ds->nopromote = _rpmds_nopromote;
155 xx = hge(h, tagEVR, &ds->EVRt, (void **) &ds->EVR, NULL);
156 xx = hge(h, tagF, &ds->Ft, (void **) &ds->Flags, NULL);
157 if (!scareMem && ds->Flags != NULL)
158 ds->Flags = memcpy(xmalloc(ds->Count * sizeof(*ds->Flags)),
159 ds->Flags, ds->Count * sizeof(*ds->Flags));
160 xx = hge(h, tagBT, &BTt, (void **) &BTp, NULL);
161 ds->BT = (xx && BTp != NULL && BTt == RPM_INT32_TYPE ? *BTp : 0);
162 ds->Color = xcalloc(Count, sizeof(*ds->Color));
163 ds->Refs = xcalloc(Count, sizeof(*ds->Refs));
165 if (_rpmds_debug < 0)
166 fprintf(stderr, "*** ds %p\t%s[%d]\n", ds, ds->Type, ds->Count);
171 /* FIX: ds->Flags may be NULL */
172 ds = rpmdsLink(ds, (ds ? ds->Type : NULL));
177 char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
183 if (dspfx) nb += strlen(dspfx) + 1;
184 if (ds->N[ds->i]) nb += strlen(ds->N[ds->i]);
185 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
186 if (ds->Flags != NULL && (ds->Flags[ds->i] & RPMSENSE_SENSEMASK)) {
188 if (ds->Flags[ds->i] & RPMSENSE_LESS) nb++;
189 if (ds->Flags[ds->i] & RPMSENSE_GREATER) nb++;
190 if (ds->Flags[ds->i] & RPMSENSE_EQUAL) nb++;
192 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
193 if (ds->EVR != NULL && ds->EVR[ds->i] && *ds->EVR[ds->i]) {
195 nb += strlen(ds->EVR[ds->i]);
198 t = tbuf = xmalloc(nb + 1);
200 t = stpcpy(t, dspfx);
204 t = stpcpy(t, ds->N[ds->i]);
205 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
206 if (ds->Flags != NULL && (ds->Flags[ds->i] & RPMSENSE_SENSEMASK)) {
207 if (t != tbuf) *t++ = ' ';
208 if (ds->Flags[ds->i] & RPMSENSE_LESS) *t++ = '<';
209 if (ds->Flags[ds->i] & RPMSENSE_GREATER) *t++ = '>';
210 if (ds->Flags[ds->i] & RPMSENSE_EQUAL) *t++ = '=';
212 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
213 if (ds->EVR != NULL && ds->EVR[ds->i] && *ds->EVR[ds->i]) {
214 if (t != tbuf) *t++ = ' ';
215 t = stpcpy(t, ds->EVR[ds->i]);
221 rpmds rpmdsThis(Header h, rpmTag tagN, int_32 Flags)
223 HGE_t hge = (HGE_t) headerGetEntryMinMemory;
226 const char * n, * v, * r;
228 const char ** N, ** EVR;
232 if (tagN == RPMTAG_PROVIDENAME) {
235 if (tagN == RPMTAG_REQUIRENAME) {
238 if (tagN == RPMTAG_CONFLICTNAME) {
241 if (tagN == RPMTAG_OBSOLETENAME) {
244 if (tagN == RPMTAG_TRIGGERNAME) {
249 xx = headerNVR(h, &n, &v, &r);
251 xx = hge(h, RPMTAG_EPOCH, NULL, (void **)&ep, NULL);
253 t = xmalloc(sizeof(*N) + strlen(n) + 1);
254 N = (const char **) t;
260 t = xmalloc(sizeof(*EVR) +
261 (ep ? 20 : 0) + strlen(v) + strlen(r) + sizeof("-"));
262 EVR = (const char **) t;
267 sprintf(t, "%d:", *ep);
270 t = stpcpy( stpcpy( stpcpy( t, v), "-"), r);
272 ds = xcalloc(1, sizeof(*ds));
278 ds->Nt = -1; /* XXX to insure that hfd will free */
280 ds->EVRt = -1; /* XXX to insure that hfd will free */
281 ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags;
284 pre[0] = ds->Type[0];
286 /* LCL: ds->Type may be NULL ??? */
287 ds->DNEVR = rpmdsNewDNEVR(pre, ds);
291 return rpmdsLink(ds, (ds ? ds->Type : NULL));
294 rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * EVR, int_32 Flags)
299 if (tagN == RPMTAG_PROVIDENAME) {
302 if (tagN == RPMTAG_REQUIRENAME) {
305 if (tagN == RPMTAG_CONFLICTNAME) {
308 if (tagN == RPMTAG_OBSOLETENAME) {
311 if (tagN == RPMTAG_TRIGGERNAME) {
316 ds = xcalloc(1, sizeof(*ds));
320 { time_t now = time(NULL);
324 ds->N = xmalloc(sizeof(*ds->N)); ds->N[0] = N;
325 ds->Nt = -1; /* XXX to insure that hfd will free */
326 ds->EVR = xmalloc(sizeof(*ds->EVR)); ds->EVR[0] = EVR;
327 ds->EVRt = -1; /* XXX to insure that hfd will free */
328 ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags;
333 ds->DNEVR = rpmdsNewDNEVR(t, ds);
337 return rpmdsLink(ds, (ds ? ds->Type : NULL));
340 int rpmdsCount(const rpmds ds)
342 return (ds != NULL ? ds->Count : 0);
345 int rpmdsIx(const rpmds ds)
347 return (ds != NULL ? ds->i : -1);
350 int rpmdsSetIx(rpmds ds, int ix)
361 const char * rpmdsDNEVR(const rpmds ds)
363 const char * DNEVR = NULL;
365 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
366 if (ds->DNEVR != NULL)
372 const char * rpmdsN(const rpmds ds)
374 const char * N = NULL;
376 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
383 const char * rpmdsEVR(const rpmds ds)
385 const char * EVR = NULL;
387 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
389 EVR = ds->EVR[ds->i];
394 int_32 rpmdsFlags(const rpmds ds)
398 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
399 if (ds->Flags != NULL)
400 Flags = ds->Flags[ds->i];
405 rpmTag rpmdsTagN(const rpmds ds)
414 time_t rpmdsBT(const rpmds ds)
417 if (ds != NULL && ds->BT > 0)
422 time_t rpmdsSetBT(const rpmds ds, time_t BT)
432 int rpmdsNoPromote(const rpmds ds)
437 nopromote = ds->nopromote;
441 int rpmdsSetNoPromote(rpmds ds, int nopromote)
446 onopromote = ds->nopromote;
447 ds->nopromote = nopromote;
452 uint_32 rpmdsColor(const rpmds ds)
456 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
457 if (ds->Color != NULL)
458 Color = ds->Color[ds->i];
463 uint_32 rpmdsSetColor(const rpmds ds, uint_32 color)
467 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
468 if (ds->Color != NULL) {
469 ocolor = ds->Color[ds->i];
470 ds->Color[ds->i] = color;
476 int_32 rpmdsRefs(const rpmds ds)
480 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
481 if (ds->Refs != NULL)
482 Refs = ds->Refs[ds->i];
487 int_32 rpmdsSetRefs(const rpmds ds, int_32 refs)
491 if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
492 if (ds->Refs != NULL) {
493 orefs = ds->Refs[ds->i];
494 ds->Refs[ds->i] = refs;
500 void rpmdsNotify(rpmds ds, const char * where, int rc)
502 if (!(ds != NULL && ds->i >= 0 && ds->i < ds->Count))
504 if (!(ds->Type != NULL && ds->DNEVR != NULL))
507 rpmMessage(RPMMESS_DEBUG, "%9s: %-45s %-s %s\n", ds->Type,
508 (!strcmp(ds->DNEVR, "cached") ? ds->DNEVR : ds->DNEVR+2),
509 (rc ? _("NO ") : _("YES")),
510 (where != NULL ? where : ""));
513 int rpmdsNext(rpmds ds)
517 if (ds != NULL && ++ds->i >= 0) {
518 if (ds->i < ds->Count) {
521 ds->DNEVR = _free(ds->DNEVR);
522 t[0] = ((ds->Type != NULL) ? ds->Type[0] : '\0');
524 ds->DNEVR = rpmdsNewDNEVR(t, ds);
529 if (_rpmds_debug < 0 && i != -1)
530 fprintf(stderr, "*** ds %p\t%s[%d]: %s\n", ds, (ds->Type ? ds->Type : "?Type?"), i, (ds->DNEVR ? ds->DNEVR : "?DNEVR?"));
537 rpmds rpmdsInit(rpmds ds)
545 const char ** rpmdsDupArgv(const char ** argv, int argc)
554 for (ac = 0; ac < argc; ac++) {
555 assert(argv[ac] != NULL);
556 nb += strlen(argv[ac]) + 1;
558 nb += (ac + 1) * sizeof(*av);
561 t = (char *) (av + ac + 1);
562 for (ac = 0; ac < argc; ac++) {
564 t = stpcpy(t, argv[ac]) + 1;
570 static rpmds rpmdsDup(const rpmds ods)
572 rpmds ds = xcalloc(1, sizeof(*ds));
575 ds->h = (ods->h != NULL ? headerLink(ods->h) : NULL);
576 ds->Type = ods->Type;
577 ds->tagN = ods->tagN;
578 ds->Count = ods->Count;
583 nb = (ds->Count+1) * sizeof(*ds->N);
584 ds->N = (ds->h != NULL
585 ? memcpy(xmalloc(nb), ods->N, nb)
586 : rpmdsDupArgv(ods->N, ods->Count) );
589 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
590 assert(ods->EVR != NULL);
591 assert(ods->Flags != NULL);
593 nb = (ds->Count+1) * sizeof(*ds->EVR);
594 ds->EVR = (ds->h != NULL
595 ? memcpy(xmalloc(nb), ods->EVR, nb)
596 : rpmdsDupArgv(ods->EVR, ods->Count) );
597 ds->EVRt = ods->EVRt;
599 nb = (ds->Count * sizeof(*ds->Flags));
600 ds->Flags = (ds->h != NULL
602 : memcpy(xmalloc(nb), ods->Flags, nb) );
605 /* FIX: ds->Flags is kept, not only */
606 return rpmdsLink(ds, (ds ? ds->Type : NULL));
610 int rpmdsFind(rpmds ds, const rpmds ods)
614 if (ds == NULL || ods == NULL)
619 while (ds->l < ds->u) {
620 ds->i = (ds->l + ds->u) / 2;
622 comparison = strcmp(ods->N[ods->i], ds->N[ds->i]);
624 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
625 if (comparison == 0 && ods->EVR && ds->EVR)
626 comparison = strcmp(ods->EVR[ods->i], ds->EVR[ds->i]);
627 if (comparison == 0 && ods->Flags && ds->Flags)
628 comparison = (ods->Flags[ods->i] - ds->Flags[ds->i]);
632 else if (comparison > 0)
640 int rpmdsMerge(rpmds * dsp, rpmds ods)
649 if (dsp == NULL || ods == NULL)
652 /* If not initialized yet, dup the 1st entry. */
656 *dsp = rpmdsDup(ods);
667 ods = rpmdsInit(ods);
669 while (rpmdsNext(ods) >= 0) {
671 * If this entry is already present, don't bother.
673 if (rpmdsFind(ds, ods) >= 0)
679 for (j = ds->Count; j > ds->u; j--)
680 ds->N[j] = ds->N[j-1];
681 ds->N[ds->u] = ods->N[ods->i];
682 N = rpmdsDupArgv(ds->N, ds->Count+1);
683 ds->N = _free(ds->N);
686 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
687 assert(ods->EVR != NULL);
688 assert(ods->Flags != NULL);
690 for (j = ds->Count; j > ds->u; j--)
691 ds->EVR[j] = ds->EVR[j-1];
692 ds->EVR[ds->u] = ods->EVR[ods->i];
693 EVR = rpmdsDupArgv(ds->EVR, ds->Count+1);
694 ds->EVR = _free(ds->EVR);
697 Flags = xmalloc((ds->Count+1) * sizeof(*Flags));
699 memcpy(Flags, ds->Flags, ds->u * sizeof(*Flags));
700 if (ds->u < ds->Count)
701 memcpy(Flags + ds->u + 1, ds->Flags + ds->u, (ds->Count - ds->u) * sizeof(*Flags));
702 Flags[ds->u] = ods->Flags[ods->i];
703 ds->Flags = _free(ds->Flags);
715 * Split EVR into epoch, version, and release components.
716 * @param evr [epoch:]version[-release] string
717 * @retval *ep pointer to epoch
718 * @retval *vp pointer to version
719 * @retval *rp pointer to release
722 void parseEVR(char * evr,
728 const char *version; /* assume only version is present */
733 while (*s && xisdigit(*s)) s++; /* s points to epoch terminator */
734 se = strrchr(s, '-'); /* se points to version terminator */
740 if (*epoch == '\0') epoch = "0";
742 epoch = NULL; /* XXX disable epoch compare if missing */
753 if (vp) *vp = version;
754 if (rp) *rp = release;
757 int rpmdsCompare(const rpmds A, const rpmds B)
759 const char *aDepend = (A->DNEVR != NULL ? xstrdup(A->DNEVR+2) : "");
760 const char *bDepend = (B->DNEVR != NULL ? xstrdup(B->DNEVR+2) : "");
762 const char *aE, *aV, *aR, *bE, *bV, *bR;
766 /* Different names don't overlap. */
767 if (strcmp(A->N[A->i], B->N[B->i])) {
772 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
773 if (!(A->EVR && A->Flags && B->EVR && B->Flags)) {
778 /* Same name. If either A or B is an existence test, always overlap. */
779 if (!((A->Flags[A->i] & RPMSENSE_SENSEMASK) && (B->Flags[B->i] & RPMSENSE_SENSEMASK))) {
784 /* If either EVR is non-existent or empty, always overlap. */
785 if (!(A->EVR[A->i] && *A->EVR[A->i] && B->EVR[B->i] && *B->EVR[B->i])) {
790 /* Both AEVR and BEVR exist. */
791 aEVR = xstrdup(A->EVR[A->i]);
792 parseEVR(aEVR, &aE, &aV, &aR);
793 bEVR = xstrdup(B->EVR[B->i]);
794 parseEVR(bEVR, &bE, &bV, &bR);
796 /* Compare {A,B} [epoch:]version[-release] */
798 if (aE && *aE && bE && *bE)
799 sense = rpmvercmp(aE, bE);
800 else if (aE && *aE && atol(aE) > 0) {
802 int lvl = (_rpmds_unspecified_epoch_noise ? RPMMESS_WARNING : RPMMESS_DEBUG);
803 rpmMessage(lvl, _("The \"B\" dependency needs an epoch (assuming same epoch as \"A\")\n\tA = \"%s\"\tB = \"%s\"\n"),
808 } else if (bE && *bE && atol(bE) > 0)
812 sense = rpmvercmp(aV, bV);
813 if (sense == 0 && aR && *aR && bR && *bR)
814 sense = rpmvercmp(aR, bR);
819 /* Detect overlap of {A,B} range. */
821 if (sense < 0 && ((A->Flags[A->i] & RPMSENSE_GREATER) || (B->Flags[B->i] & RPMSENSE_LESS))) {
823 } else if (sense > 0 && ((A->Flags[A->i] & RPMSENSE_LESS) || (B->Flags[B->i] & RPMSENSE_GREATER))) {
825 } else if (sense == 0 &&
826 (((A->Flags[A->i] & RPMSENSE_EQUAL) && (B->Flags[B->i] & RPMSENSE_EQUAL)) ||
827 ((A->Flags[A->i] & RPMSENSE_LESS) && (B->Flags[B->i] & RPMSENSE_LESS)) ||
828 ((A->Flags[A->i] & RPMSENSE_GREATER) && (B->Flags[B->i] & RPMSENSE_GREATER)))) {
833 if (_noisy_range_comparison_debug_message)
834 rpmMessage(RPMMESS_DEBUG, _(" %s A %s\tB %s\n"),
835 (result ? _("YES") : _("NO ")), aDepend, bDepend);
836 aDepend = _free(aDepend);
837 bDepend = _free(bDepend);
841 void rpmdsProblem(rpmps ps, const char * pkgNEVR, const rpmds ds,
842 const fnpyKey * suggestedKeys, int adding)
844 const char * Name = rpmdsN(ds);
845 const char * DNEVR = rpmdsDNEVR(ds);
846 const char * EVR = rpmdsEVR(ds);
850 if (ps == NULL) return;
852 if (Name == NULL) Name = "?N?";
853 if (EVR == NULL) EVR = "?EVR?";
854 if (DNEVR == NULL) DNEVR = "? ?N? ?OP? ?EVR?";
856 rpmMessage(RPMMESS_DEBUG, _("package %s has unsatisfied %s: %s\n"),
857 pkgNEVR, ds->Type, DNEVR+2);
859 switch ((unsigned)DNEVR[0]) {
860 case 'C': type = RPMPROB_CONFLICT; break;
862 case 'R': type = RPMPROB_REQUIRES; break;
865 key = (suggestedKeys ? suggestedKeys[0] : NULL);
866 rpmpsAppend(ps, type, pkgNEVR, key, NULL, NULL, DNEVR, adding);
869 int rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote)
872 rpmds provides = NULL;
875 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
876 if (req->EVR == NULL || req->Flags == NULL)
879 if (!(req->Flags[req->i] & RPMSENSE_SENSEMASK) || !req->EVR[req->i] || *req->EVR[req->i] == '\0')
882 /* Get provides information from header */
883 provides = rpmdsInit(rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem));
884 if (provides == NULL)
885 goto exit; /* XXX should never happen */
887 (void) rpmdsSetNoPromote(provides, nopromote);
890 * Rpm prior to 3.0.3 did not have versioned provides.
891 * If no provides version info is available, match any/all requires
894 if (provides->EVR == NULL) {
900 if (provides != NULL)
901 while (rpmdsNext(provides) >= 0) {
903 /* Filter out provides that came along for the ride. */
904 if (strcmp(provides->N[provides->i], req->N[req->i]))
907 result = rpmdsCompare(provides, req);
909 /* If this provide matches the require, we're done. */
915 provides = rpmdsFree(provides);
920 int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
922 HGE_t hge = (HGE_t)headerGetEntryMinMemory;
923 const char * pkgN, * v, * r;
927 int_32 pkgFlags = RPMSENSE_EQUAL;
929 int rc = 1; /* XXX assume match, names already match here */
931 /* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
932 if (req->EVR == NULL || req->Flags == NULL)
935 if (!((req->Flags[req->i] & RPMSENSE_SENSEMASK) && req->EVR[req->i] && *req->EVR[req->i]))
938 /* Get package information from header */
939 (void) headerNVR(h, &pkgN, &v, &r);
941 t = alloca(21 + strlen(v) + 1 + strlen(r) + 1);
944 if (hge(h, RPMTAG_EPOCH, NULL, (void **) &epoch, NULL)) {
945 sprintf(t, "%d:", *epoch);
949 (void) stpcpy( stpcpy( stpcpy(t, v) , "-") , r);
951 if ((pkg = rpmdsSingle(RPMTAG_PROVIDENAME, pkgN, pkgEVR, pkgFlags)) != NULL) {
953 (void) rpmdsSetNoPromote(pkg, nopromote);
954 rc = rpmdsCompare(pkg, req);
955 pkg = rpmdsFree(pkg);