Bug 2359090

Summary: Modifying computed version with %forgeversion -z does not yield desired result
Product: [Fedora] Fedora Reporter: Sandro <gui1ty>
Component: forge-srpm-macrosAssignee: Maxwell G <maxwell>
Status: POST --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 45CC: code, maxwell
Target Milestone: ---Flags: fedora-admin-xmlrpc: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

Comment 2 Aoife Moloney 2026-08-17 13:35:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.