Only add arch, os and platform, self-provides once

per package even if we do multiple parse passes. This is a quick fix for
the dynamic spec feature that executes the parsing code multiple times.

This needs to be sorted out properly to only do the necessary things
(for the build scripts) here and postpone everything else after the
secondary parses. But that requires larger changes.
This commit is contained in:
Florian Festi 2023-06-15 13:41:51 +02:00 committed by Panu Matilainen
parent 8ec9cfc81c
commit ced4d24f08
1 changed files with 3 additions and 0 deletions

View File

@ -742,6 +742,9 @@ static void addTargets(Package Pkgs)
char *optflags = rpmExpand("%{optflags}", NULL); char *optflags = rpmExpand("%{optflags}", NULL);
for (Package pkg = Pkgs; pkg != NULL; pkg = pkg->next) { for (Package pkg = Pkgs; pkg != NULL; pkg = pkg->next) {
if (headerIsEntry(pkg->header, RPMTAG_OS)) {
continue;
}
headerPutString(pkg->header, RPMTAG_OS, os); headerPutString(pkg->header, RPMTAG_OS, os);
/* noarch subpackages already have arch set here, leave it alone */ /* noarch subpackages already have arch set here, leave it alone */
if (!headerIsEntry(pkg->header, RPMTAG_ARCH)) { if (!headerIsEntry(pkg->header, RPMTAG_ARCH)) {