Re: How to set SCM date in %autorelease

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 16, 2023 at 5:39 AM Neal Gompa <ngompa13@xxxxxxxxx> wrote:
>
> On Mon, May 15, 2023 at 11:35 PM Orion Poplawski <orion@xxxxxxxx> wrote:
> >
> > I've got the following:
> >
> > %global goipath         github.com/dustin/gomemcached
> > %global commit          a2284a01c143e355985d192edf3b62a053747c70
> > %global shortcommit     %(c=%{commit}; echo ${c:0:7})
> >
> > %gometa -f
> >
> > %global common_description %{expand:
> > A memcached binary protocol toolkit for go.}
> >
> > %global golicenses      LICENSE
> > %global godocs          README.markdown example
> >
> > Name:           %{goname}
> > Version:        0
> > Release:        %autorelease -p
> > Summary:        A memcached binary protocol toolkit for go
> >
> > Which gives me:
> >
> > Release:        0.1.20230224gita2284a0.fc39
> >
> > Looks like 20230224 is coming from the date of the tarball.  I want to
> > set the date to the date of the last upstream commit - 20160816.
> >
> > https://docs.pagure.org/Fedora-Infra.rpmautospec/autorelease.html#traditional-versioning-with-part-of-the-upstream-version-information-in-the-release-field
> >
> > indicates that I should be able to use -s to set the <snapinfo> part of
> > the release tag, so I do:
> >
> > Release:        %autorelease -p -s 20160816git%{shortcommit}
> >
> > but that gives me:
> >
> > Release:        0.1.20160816gita2284a0.20230224gita2284a0.fc39
> >
> > So, how do I override the SCM date?
> >
>
> You don't. Don't use those features in %autorelease and put them in
> Version: instead.
>
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots

That's good advice in most circumstances, but in the case of Go /
forge macros, that's not possible.
They put snapshot information into %distprefix (yeah, ugly hack).

However, you can override the commit date by adding "%global date YYYYMMDD":
https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/macros.forge#_13

Fabio
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux