} else if (flags & RPMSENSE_PREREQ) {
rpmMessage(RPMMESS_DEBUG, "Adding prereq: %s\n", name);
p->numPreReq++;
+ } else if (flags & RPMSENSE_OBSOLETES) {
+ rpmMessage(RPMMESS_DEBUG, "Adding obsoletes: %s\n", name);
+ p->numPreReq++;
} else {
rpmMessage(RPMMESS_DEBUG, "Adding require: %s\n", name);
p->numReq++;
*namePtr++ = rd->name;
*versionPtr++ = rd->version ? rd->version : "";
*flagPtr++ = (rd->flags & RPMSENSE_SENSEMASK) |
- (rd->flags & RPMSENSE_PREREQ);
+ (rd->flags & RPMSENSE_PREREQ) |
+ (rd->flags & RPMSENSE_OBSOLETES);
}
rd = rd->next;
}
case RPMTAG_PREREQ:
flags = RPMSENSE_PREREQ;
break;
+ case RPMTAG_OBSOLETES:
+ flags = RPMSENSE_OBSOLETES;
+ break;
default:
flags = RPMSENSE_ANY;
break;
"No file names in Conflicts: %s", req);
return RPMERR_BADSPEC;
}
+ if (flag == RPMTAG_OBSOLETES && req[0] == '/') {
+ rpmError(RPMERR_BADSPEC,
+ "No file names in Obsoletes: %s", req);
+ return RPMERR_BADSPEC;
+ }
if ((version = strtok(NULL, " ,\t\n"))) {
rc = ReqComparisons;
while (rc->token && strcmp(version, rc->token)) {
"No versions in PreReq: %s", req);
return RPMERR_BADSPEC;
}
+ if (flag == RPMTAG_OBSOLETES) {
+ rpmError(RPMERR_BADSPEC,
+ "No versions in Obsoletes: %s", req);
+ return RPMERR_BADSPEC;
+ }
/* read a version */
flags |= rc->flags;
version = strtok(NULL, " ,\t\n");
{RPMTAG_REQUIREFLAGS, 0, "requires"},
{RPMTAG_PREREQ, 0, "prereq"},
{RPMTAG_CONFLICTFLAGS, 0, "conflicts"},
+ {RPMTAG_OBSOLETES, 0, "obsoletes"},
{RPMTAG_DEFAULTPREFIX, 0, "prefix"},
{RPMTAG_BUILDROOT, 0, "buildroot"},
{RPMTAG_BUILDARCHS, 0, "buildarchitectures"},
case RPMTAG_REQUIREFLAGS:
case RPMTAG_CONFLICTFLAGS:
case RPMTAG_PREREQ:
+ case RPMTAG_OBSOLETES:
if (parseRequiresConflicts(cur_package, s, tag)) {
return NULL;
}
#define RPMTAG_PREUNPROG 1087
#define RPMTAG_POSTUNPROG 1088
#define RPMTAG_BUILDARCHS 1089
+#define RPMTAG_OBSOLETES 1090 /* internal */
#define RPMTAG_EXTERNAL_TAG 1000000
#define RPMSENSE_PROVIDES (1 << 4) /* only used internally by builds */
#define RPMSENSE_CONFLICTS (1 << 5) /* only used internally by builds */
#define RPMSENSE_PREREQ (1 << 6)
+#define RPMSENSE_OBSOLETES (1 << 7)
#define RPMSENSE_SENSEMASK 15 /* Mask to get senses, ie serial, */
/* less, greater, equal. */