headerNVR(p->h, &p->name, &p->version, &p->release);
- p->hasEpoch = headerGetEntry(h, RPMTAG_EPOCH, NULL, (void **) &p->epoch,
- NULL);
+ if (!headerGetEntry(h, RPMTAG_EPOCH, NULL, (void **) &p->epoch, NULL))
+ p->epoch = NULL;
if (!headerGetEntry(h, RPMTAG_PROVIDENAME, NULL, (void **) &p->provides,
&p->providesCount)) {
version = s;
if (*epoch == '\0') epoch = "0";
} else {
- epoch = "0";
+ epoch = NULL; /* XXX disable epoch compare if missing */
version = evr;
}
if (se) {
int headerMatchesDepFlags(Header h, const char *reqName, const char * reqEVR, int reqFlags)
{
const char *name, *version, *release;
- int_32 * epochval;
+ int_32 * epoch;
char *pkgEVR;
int pkgFlags = RPMSENSE_EQUAL;
int type, count;
pkgEVR = alloca(21 + strlen(version) + 1 + strlen(release) + 1);
*pkgEVR = '\0';
- if (headerGetEntry(h, RPMTAG_EPOCH, &type, (void **) &epochval, &count))
- sprintf(pkgEVR, "%d:", *epochval);
+ if (headerGetEntry(h, RPMTAG_EPOCH, &type, (void **) &epoch, &count))
+ sprintf(pkgEVR, "%d:", *epoch);
strcat(pkgEVR, version);
strcat(pkgEVR, "-");
strcat(pkgEVR, release);
dbiIndexSet matches;
int rc;
- if (rpmdep->db == NULL) return 0;
+ if (rpmdep->db == NULL)
+ return 0;
if (rpmdbFindByConflicts(rpmdep->db, key, &matches)) {
return 0;
return 0;
}
-static char *buildEVR(const char *v, const char *r)
+static char *buildEVR(int_32 *e, const char *v, const char *r)
{
- char *pEVR = malloc(strlen(v) + 1 + strlen(r) + 1);
- strcpy(pEVR, v);
+ char *pEVR = malloc(21 + strlen(v) + 1 + strlen(r) + 1);
+ *pEVR = '\0';
+ if (e)
+ sprintf(pEVR, "%d:", *e);
+ strcat(pEVR, v);
strcat(pEVR, "-");
strcat(pEVR, r);
return pEVR;
are satisfied */
p = rpmdep->addedPackages.list;
for (i = 0; i < rpmdep->addedPackages.size; i++, p++) {
- pEVR = buildEVR(p->version, p->release);
+ pEVR = buildEVR(p->epoch, p->version, p->release);
if (checkPackageDeps(rpmdep, &ps, p->h, NULL, NULL, 0))
goto exit;
/* now look at the removed packages and make sure they aren't critical */
for (i = 0; i < rpmdep->numRemovedPackages; i++) {
const char *name, *version, *release;
+ int_32 *epoch;
h = rpmdbGetRecord(rpmdep->db, rpmdep->removedPackages[i]);
if (h == NULL) {
}
headerNVR(h, &name, &version, &release);
- pEVR = buildEVR(version, release);
+ if (!headerGetEntry(h, RPMTAG_EPOCH, &type, (void **)&epoch, &count))
+ epoch = NULL;
+ pEVR = buildEVR(epoch, version, release);
if (checkDependentPackages(rpmdep, &ps, name, pEVR, RPMSENSE_EQUAL))
goto exit;
void *sig;
int ret = -1;
- rpmMessage(RPMMESS_VERBOSE, _("Generating signature: %d\n"), sigTag);
switch (sigTag) {
case RPMSIGTAG_SIZE:
stat(file, &statbuf);
break;
case RPMSIGTAG_PGP5: /* XXX legacy */
case RPMSIGTAG_PGP:
+ rpmMessage(RPMMESS_VERBOSE, _("Generating signature using PGP.\n"));
ret = makePGPSignature(file, &sig, &size, passPhrase);
if (ret == 0)
headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size);
break;
case RPMSIGTAG_GPG:
+ rpmMessage(RPMMESS_VERBOSE, _("Generating signature using GPG.\n"));
ret = makeGPGSignature(file, &sig, &size, passPhrase);
if (ret == 0)
headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size);