#2760 RFE: provide %{?dist} tag value in Koji build output
Opened 3 years ago by dcantrell. Modified 3 years ago

This would be useful at least for a request I was asked about in rpminspect. The idea is that rpminspect can check that the RPMTAG_RELEASE tag contains the expected dist tag for the build target. Since that is a macro expanded by rpmbuild in the mock chroot, it is hard to know what the expected one should be. What would be nice is to have a mapping of koji build targets to expected dist tags. But then that's data that has to live somewhere, and I don't think it needs to be that complicated. Koji is already running the build via mock, so what if mock could just report the expanded dist tag and Koji collect that value and add it to the dict returned by getBuild? Basically just have it run:

mock -r CHROOT --chroot 'rpmbuild --eval "%{dist}"'

And capture the resulting string. This would be useful to me because I could ask Koji what the expected dist tag is for the builds. Then if I look at the built RPMs and do not see that string or a variant of it in RPMTAG_RELEASE, then I know if the spec file lacks an appropriate %{?dist} construct.

If this information is already available from Koji, please let me know.


If your tag admins are setting the dist tag via tag.extra, you can query the dist value for a build tag with the api. However, it doesn't look like Fedora is handling dist tags this way.

Metadata Update from @mikem:
- Custom field Size adjusted to None

3 years ago

Yeah, I'm pretty sure the Fedora dist tags are handled by /usr/lib/rpm/macros.d/macros.dist via the fedora-release package. So it's expanded by rpmbuild at runtime. That's what led me to the request above.

rhpkg does this by hard-coding some logic, and I imagine fedpkg takes a similar approach

See the code in rpkg's load_rpmdefines() method, and the way fedpkg overloads with its own load_rpmdefines().

Login to comment on this ticket.

Metadata