Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

rpmte: Don't use list of tags #3564

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions lib/rpmte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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() */
Expand Down