public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/fedora-release] f45: RPM macros: Redefining %fedora now changes %dist
Date: Mon, 10 Aug 2026 09:34:57 GMT	[thread overview]
Message-ID: <178635449767.1.15834236285396785413.rpms-fedora-release-7a2518287bd7@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/fedora-release
            Branch : f45
            Commit : 7a2518287bd7d1f35d2b95797c6916f850712118
            Author : Miro Hrončok <miro@hroncok.cz>
            Date   : 2019-09-03T23:55:13+02:00
            Stats  : +5/-2 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedora-release/c/7a2518287bd7d1f35d2b95797c6916f850712118?branch=f45

            Log:
            RPM macros: Redefining %fedora now changes %dist

To get a deterministic NEVR including the dist tag on a different release,
it used to be enough to call `rpm` with:

    --define 'dist .fcXX'

Later it got more complicated:

    --define 'dist %{?distprefix}.fcXX%{?with_bootstrap:~bootstrap}'

And now it is even more complicated:

    --define 'dist %{!?distprefix0:%{?distprefix}}%{expand:%{lua:for i=0,9999 do print("%{?distprefix" .. i .."}") end}}.fcXX%{?with_bootstrap:~bootstrap}'

It becomes more and more tedious. This change makes it possible to do this instead:

    --define 'fedora XX'

Signed-off-by: There is nothing to sign

---
diff --git a/fedora-release.spec b/fedora-release.spec
index bdc3129..505d69e 100644
--- a/fedora-release.spec
+++ b/fedora-release.spec
@@ -14,7 +14,7 @@
 Summary:        Fedora release files
 Name:           fedora-release
 Version:        32
-Release:        0.1
+Release:        0.2
 License:        MIT
 URL:            https://fedoraproject.org/
 
@@ -481,7 +481,7 @@ cat >> %{buildroot}%{_rpmconfigdir}/macros.d/macros.dist << EOF
 
 %%fedora              %{dist_version}
 %%__bootstrap         ~bootstrap
-%%dist                %%{!?distprefix0:%%{?distprefix}}%%{expand:%%{lua:for i=0,9999 do print("%%{?distprefix" .. i .."}") end}}.fc%{dist_version}%%{?with_bootstrap:%{__bootstrap}}
+%%dist                %%{!?distprefix0:%%{?distprefix}}%%{expand:%%{lua:for i=0,9999 do print("%%{?distprefix" .. i .."}") end}}.fc%%{fedora}%%{?with_bootstrap:%{__bootstrap}}
 %%fc%{dist_version}                1
 EOF
 
@@ -642,6 +642,9 @@ echo _DISABLED_ > %{buildroot}%{_prefix}/lib/variant
 
 
 %changelog
+* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 32-0.2
+- RPM macros: Redefining %%fedora now changes %%dist
+
 * Tue Aug 13 2019 Mohan Boddu <mboddu@bhujji.com> - 32-0.1
 - Setup for rawhide being F32
 - Disable zram-swap service (sgallagh)

                 reply	other threads:[~2026-08-10  9:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178635449767.1.15834236285396785413.rpms-fedora-release-7a2518287bd7@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox