Blob Blame History Raw
From 9a316cbeb61549b3004692c9dd8437b9fa805e74 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Thu, 9 Mar 2017 12:12:32 +0100
Subject: [PATCH] Fix check whether to allow rich deps in a given tag

Broken with 9d5bbd9774d00f50749bb045217eaf91c87b6de0

(cherry picked from commit e4349ef7292578a7286bfca2e68a150422e65c3c)
---
 build/parseReqs.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/build/parseReqs.c b/build/parseReqs.c
index bd728ed2d..6c2aead4e 100644
--- a/build/parseReqs.c
+++ b/build/parseReqs.c
@@ -129,6 +129,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN,
     rpmTagVal nametag = RPMTAG_NOT_FOUND;
     rpmsenseFlags Flags;
     rpmRC rc = RPMRC_FAIL; /* assume failure */
+    int allow_richdeps = 0;
 
     switch (tagN) {
     default:
@@ -139,9 +140,11 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN,
     case RPMTAG_SUGGESTNAME:
     case RPMTAG_SUPPLEMENTNAME:
     case RPMTAG_ENHANCENAME:
+    case RPMTAG_CONFLICTNAME:
+	allow_richdeps = 1;
+	/* fall through */
     case RPMTAG_PROVIDENAME:
     case RPMTAG_OBSOLETENAME:
-    case RPMTAG_CONFLICTNAME:
     case RPMTAG_ORDERNAME:
 	nametag = tagN;
 	break;
@@ -149,6 +152,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN,
 	/* XXX map legacy PreReq into Requires(pre,preun) */
 	nametag = RPMTAG_REQUIRENAME;
 	tagflags |= (RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_PREUN);
+	allow_richdeps = 1;
 	break;
     case RPMTAG_TRIGGERPREIN:
 	nametag = RPMTAG_TRIGGERNAME;
@@ -209,9 +213,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN,
 
 	if (r[0] == '(') {
 	    struct parseRCPOTRichData data;
-	    if (nametag != RPMTAG_REQUIRENAME && nametag != RPMTAG_CONFLICTNAME &&
-			nametag != RPMTAG_RECOMMENDNAME && nametag != RPMTAG_SUPPLEMENTNAME &&
-			nametag != RPMTAG_SUGGESTNAME && nametag != RPMTAG_ENHANCENAME) {
+	    if (!allow_richdeps) {
 		rasprintf(&emsg, _("No rich dependencies allowed for this type"));
 		goto exit;
 	    }