From 5ee853737279f442ac00a8d3baebf71104410f7b Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Fri, 24 Jan 2025 13:50:31 +0100 Subject: [PATCH] rpmte: Don't use list of tags This is only over complicated as there is no common way to initialize them all. Related: #3538 --- lib/rpmte.cc | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/rpmte.cc b/lib/rpmte.cc index a4f866c153..97b27a5a2d 100644 --- a/lib/rpmte.cc +++ b/lib/rpmte.cc @@ -77,12 +77,6 @@ struct rpmte_s { rpmfs fs; }; -auto dependency_tags = { - RPMTAG_PROVIDENAME, RPMTAG_SUPPLEMENTNAME, RPMTAG_ENHANCENAME, - RPMTAG_REQUIRENAME, RPMTAG_RECOMMENDNAME, RPMTAG_SUGGESTNAME, - RPMTAG_CONFLICTNAME, RPMTAG_OBSOLETENAME, RPMTAG_ORDERNAME, - RPMTAG_NAME}; - /* forward declarations */ static void rpmteColorDS(rpmte te, rpmTag tag); static int rpmteClose(rpmte te, int reset_fi); @@ -182,13 +176,14 @@ static int addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs) p->pkgFileSize = 0; p->headerSize = headerSizeof(h, HEADER_MAGIC_NO); - for (rpmTagVal tag : dependency_tags) { - if (tag == RPMTAG_NAME) { - p->dependencies[tag] = \ - rpmdsThisPool(tspool, h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); - } else { - p->dependencies[tag] = rpmdsNewPool(tspool, h, tag, 0); - } + p->dependencies[RPMTAG_NAME] = \ + rpmdsThisPool(tspool, h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); + for (rpmTagVal tag : { + RPMTAG_PROVIDENAME, RPMTAG_SUPPLEMENTNAME, RPMTAG_ENHANCENAME, + RPMTAG_REQUIRENAME, RPMTAG_RECOMMENDNAME, RPMTAG_SUGGESTNAME, + RPMTAG_CONFLICTNAME, RPMTAG_OBSOLETENAME, RPMTAG_ORDERNAME + }) { + p->dependencies[tag] = rpmdsNewPool(tspool, h, tag, 0); } /* Relocation needs to know file count before rpmfiNew() */