#678 Use release's rpmdefines in unused sources check
Merged by onosek. Opened by oturpe.
oturpe/rpkg rpmdefines-when-checking-unused-sources  into  master

Download 678.patch

Conditional Source: tags are problematic and, in fact, forbidden in at
least Fedora. However, there are packages that conditionalize packages
based on macros such as %{rhel} or %{fedora}. 'x-pkg sources' did not
handle such packages correctly, because when the specfile was parsed
to check for unused sources, values for those macros were not set. This
was different from other commands which set such macros based on the
value of --release parameter or Git branch name.

Improve support for conditional Source: tags by using the standard set
of rpmdefines when the specfile is parsed in 'fedpkg sources'.

Fixes #671

Signed-off-by: Otto Liljalaakso otto.liljalaakso@iki.fi

I would still like to test this more, and perhaps add some automatic tests.
But if you think this is correct and fixes the issue, I will not object to merge.

I'll check it out this week.

Tested and provided feedback in https://pagure.io/rpkg/issue/671#comment-850554

Suggestion:

self.log.warning("Could not determine distribution macros from branch and/or --release.")

Possibly emmit the err message to the debug log.

rebased onto 4c0e1fb0576f66f5d12f7e561072ece51468d287

rebased onto 95fb02d8f71d27445f22fe81ea5661af048f3ed1

Commit 8667d537 fixes this pull-request

Pull-Request has been merged by onosek

Thanks. I added one test case and repaired SpecFile tests.

Thank you for merging, and especially for fixing the tests —
that was on my TODO list, but unfortunately I could not find the time to get there.

You're welcome. But what did I miss? The message? I just thought you are standing your ground :-).

I am not sure what you are referring to, perhaps to comments the fixed issue #671?

I do not think you missed anything.
From my perspective, everything is fine here,
A bug has been fixed and error messages are being improved, good progress.

I was thinking about Miro's comment.
https://pagure.io/rpkg/pull-request/678/comment/186365

Metadata