Map deprecated PreReq tags to Requires

Convert PreReq tags without qualifiers into Requires(pre,postun)
and PreReq tags with qualifiers into Requires tags with those qualifiers.

This matches compare_deps() behaviour and opens the way
for additional optimizations of dependencies.
This commit is contained in:
Дмитрий Левин 2019-01-14 20:56:55 +00:00
parent f7280d8302
commit e05c6cf019

View File

@ -58,7 +58,19 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag,
h = spec->buildRestrictions;
break;
case RPMTAG_PREREQ:
tagflags |= RPMSENSE_PREREQ;
tag = RPMTAG_REQUIREFLAGS;
if (tagflags == RPMSENSE_ANY) {
tagflags = RPMSENSE_SCRIPT_PRE | RPMSENSE_SCRIPT_POSTUN;
rpmlog(RPMLOG_WARNING,
_("line %d: Deprecated PreReq converted"
" to Requires(pre,postun): %s\n"),
spec->lineNum, spec->line);
} else {
rpmlog(RPMLOG_WARNING,
_("line %d: Deprecated PreReq converted"
" to Requires: %s\n"),
spec->lineNum, spec->line);
}
h = pkg->header;
break;
case RPMTAG_BUILDPREREQ: