#223 %{dist} field is mandatory, so fedora-release cannot use %autorelease
Opened 9 months ago by zbyszek. Modified 9 months ago

fedora-release is one of those packages where rebase conflicts are a major pita, and where it would be really great to use rpmautospec. Alas, $subject.

The package has

Version:        36
Release:        0.2%{?eln:.eln%{eln}}

As you can see, there is no %dist, because Version contains the necessary information.

Release:        %autorelease -p

works partially: but is not enough: %dist is still inserted, and I don't see how post-release releases like 1.1, 1.2, … can be supported by %autorelease.

I think two parameters should be added:
- one to specify the %dist part, e.g. --dist '' or --dist %{?eln:.eln%{eln}}.
- one to specify the prefix part, e.g. -P. If this is implemented, -p is not necessary. Just specify -P 0 to mean -p.

After a good night's sleep, the problems I saw yesterday seem easy to solve:
- %global dist %nil solves the issue with dist.
- and the prefix part should not be a problem: it is either 0. or empty, so -p should be good enough.

So I think it can made to work. I'll make a pull request for the fedora-release package and I'll ask for your review there. (I can test if things work with the current version, but I'm not sure if the approach will be sustainable and will not break with future rpmautospec changes.)

Pull requests:
https://src.fedoraproject.org/rpms/fedora-release/pull-request/194 (rawhide)
https://src.fedoraproject.org/rpms/fedora-release/pull-request/195 (f35)
https://src.fedoraproject.org/rpms/fedora-release/pull-request/196 (f34)

It seems to mostly work, but f34 gets this changelog:

* Mon Aug 16 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> 34-36
- Bump release

* Mon Apr 12 2021 Mohan Boddu <mboddu@bhujji.com> - 34-1
- Setup for F34 Final

* Thu Apr 01 2021 Stephen Gallagher <sgallagh@redhat.com> - 34-0.15
- Enable certbot-renew.timer (bz1942011)

I tried inserting a negative offset, with %{autorelease -b -34} but that spec file fails to parse.

Login to comment on this ticket.