Skip to content
Snippets Groups Projects
  • Paul Spooren's avatar
    9ae3c6f9
    rules: add AUTORELEASE and COMMITCOUNT variables · 9ae3c6f9
    Paul Spooren authored
    
    The lack of bumped PKG_RELEASE variables is a recurring theme on the
    mailing list and in GitHub comments. This costs precious review time,
    a rare good within the OpenWrt project.
    
    Instead of relying on a manually set PKG_RELEASE this commit adds a
    `commitcount` function that uses the number of Git commits to determine
    the release. The function is called via the variables `$(AUTORELEASE)`
    or `$(COMMITCOUNT)`. The `PKG_RELEASE` variable can be set to either of
    the two.
    
    - $(AUTORELEASE):
    
    Release is automagically set to the number of commits since the last
    commit containing either ": update to " or ": bump to ".
    
    Example below:
    
        $ git log packages/foobar/
        foobar: fixup file location
        foobar: disable docs
        foobar: bump to 5.3.2
        foobar: fixup copyright
    
    Resulting package name: foobar_5.3.2-3_all.ipk, two package changes
    since the last upstream version change, using a 1 based counter.
    
    - $(COMMITCOUNT):
    
    For non-traditional versioning (x.y.z), most prominent `base-files`,
    this variable contains the total number of package commits.
    
    The new functionality can also be used by other feeds like packages.git.
    
    In case no build information is available, e.g. when using release
    tarballs, the SOURCE_DATE_EPOCH is used to have a reproducible release
    identifier.
    
    Suggested-by: default avatarDaniel Golle <daniel@makrotopia.org>
    Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
    9ae3c6f9
    History
    rules: add AUTORELEASE and COMMITCOUNT variables
    Paul Spooren authored
    
    The lack of bumped PKG_RELEASE variables is a recurring theme on the
    mailing list and in GitHub comments. This costs precious review time,
    a rare good within the OpenWrt project.
    
    Instead of relying on a manually set PKG_RELEASE this commit adds a
    `commitcount` function that uses the number of Git commits to determine
    the release. The function is called via the variables `$(AUTORELEASE)`
    or `$(COMMITCOUNT)`. The `PKG_RELEASE` variable can be set to either of
    the two.
    
    - $(AUTORELEASE):
    
    Release is automagically set to the number of commits since the last
    commit containing either ": update to " or ": bump to ".
    
    Example below:
    
        $ git log packages/foobar/
        foobar: fixup file location
        foobar: disable docs
        foobar: bump to 5.3.2
        foobar: fixup copyright
    
    Resulting package name: foobar_5.3.2-3_all.ipk, two package changes
    since the last upstream version change, using a 1 based counter.
    
    - $(COMMITCOUNT):
    
    For non-traditional versioning (x.y.z), most prominent `base-files`,
    this variable contains the total number of package commits.
    
    The new functionality can also be used by other feeds like packages.git.
    
    In case no build information is available, e.g. when using release
    tarballs, the SOURCE_DATE_EPOCH is used to have a reproducible release
    identifier.
    
    Suggested-by: default avatarDaniel Golle <daniel@makrotopia.org>
    Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.