kkleine / rpms / python-lit

Forked from rpms/python-lit 2 years ago
Clone

63a3f3a Use %autochangelog and %autorelease macros

Authored and Committed by kkleine 2 years ago
    Use %autochangelog and %autorelease macros
    
    This change introduces the [`%autochangelog`](1) and [`%autorelease`](2) macros.
    
    Everytime the `Version:` tag is increased, the `Release:` tag will be
    reset to `1`.
    
    What do we get out of this change?
    ----------------------------------
    
    I've had a long discussion with Zbigniew Jedrzejewski Szmek <zjedrzej@redhat.com> about
    this. The outcome is as follows:
    
    1. A packager no longer has to manually increase the number in the
       `Release:` tag or reset it. Increasing is always done when a new commit is
       made. Resetting happens automatically when you bump the `Version:`
       tag from 13.0.0 to `14.0.0` for example.
    
    2. A package cosumer is supposed to look at the output of
       `rpm -q --changelog <PACKAGE>`. Packagers themselves only need to
       care about the first line of their next commit when authoring
       patches.
    
    3. The newly added `changelog` file in this patch contains the old
       content of the `%changelog` section in the spec file.
       I was at first confused for why we not simply keep the section as
       is and have the first line of the new commits appear in the final
       spec file. But I was told that having a very clean spec file makes
       cherry picking patches much more simple. I can see why that is by
       looking at my own history.
    
    This patch only makes sense, if we use %autochangelog and %autorelease
    in the rest of the branches for each package as well. Then we can more easily
    backport patches for example.
    
    [1]: https://docs.pagure.org/fedora-infra.rpmautospec/autochangelog.html
    [2]: https://docs.pagure.org/fedora-infra.rpmautospec/autorelease.html#using-autorelease
    
        
file added
+155
file added
+5
file modified
+2 -156