Bug 2359090 - Modifying computed version with %forgeversion -z does not yield desired result
Summary: Modifying computed version with %forgeversion -z does not yield desired result
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: forge-srpm-macros
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Maxwell G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-04-11 14:00 UTC by Sandro
Modified: 2026-06-10 18:54 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
fedora-admin-xmlrpc: mirror+


Attachments (Terms of Use)

Description Sandro 2025-04-11 14:00:40 UTC
For an RPM with multiple sources the computed version string always includes the commit information for the secondary sources. I tried varying combinations of %forgemeta and %forgeversion with the -z option, but the end result is always an all inclusive version string.

In a spec file with:

%global forgeurl0 https://github.com/citeproc-py/citeproc-py
%global forgeurl1 https://github.com/citation-style-language/schema
%global forgeurl2 https://github.com/citation-style-language/locales

%global version0 0.8.2
%global commit1 e295d63
%global commit2 bd8d2db

%forgemeta -a

Version:        %forgeversion
Release:        %autorelease

the final Version is set to "0.8.2-1.s20250328gite295d63.s20250328gitbd8d2db".

According to the documentation in the source `-z0` is the default for %forgeversion. Passing `-z0` explicitly doesn't change anything.

Seemingly `%forgemeta -a` gets in the way and overrules (passes on) the behavior to %forgeversion. When using `%forgemeta -z0` followed by `%forgeversion` it works.

But since I need the other source URLs as weel,, I have to invoke `%forgemeta -z1` and `%forgemeta -z2` at some point. As soon as I invoke those the version string is expanded again regardless of whether or not I add `-z0` to `%forgeversion`.

I would expect the following to work:

%global forgeurl0 https://github.com/citeproc-py/citeproc-py
%global forgeurl1 https://github.com/citation-style-language/schema
%global forgeurl2 https://github.com/citation-style-language/locales

%global version0 0.8.2
%global commit1 e295d63
%global commit2 bd8d2db

%forgemeta -z0

Version:        %forgeversion -z0
Release:        %autorelease

URL:            %forgeurl
Source0:        %forgesource0
%forgemeta -z1
Source1:        %forgesource1
%forgemeta -z2
Source2:        %forgesource2

Though, it is a bit clumsy. I'd prefer the first snippet using `%forgemeta -a` and possibly having to add `-z0` to `%forgeversion`.

Currently, no combination of flags or macro ordering appears to yield the desired result of not adding the `%_forgeversionsuffix` of the secondary sources to Version.

Reproducible: Always


Note You need to log in before you can comment on or make changes to this bug.