[Rpm-maint] [rpm-software-management/rpm] How to expand possibly non-existent user constructed variable name? (Discussion #3411)

Vít Ondruch notifications at github.com
Wed Oct 30 07:56:01 UTC 2024


> It would help to understand the actual use-case behind this.

This is the original macro:

https://src.fedoraproject.org/rpms/ruby/blob/05a6c9c8f3bbc26d12835736791431c74d07552d/f/macros.rubygems#_15

And here you can see its usage:

https://src.fedoraproject.org/rpms/ruby/blob/05a6c9c8f3bbc26d12835736791431c74d07552d/f/ruby.spec#_137
https://src.fedoraproject.org/rpms/ruby/blob/05a6c9c8f3bbc26d12835736791431c74d07552d/f/ruby.spec#_1588-1598

When the gems are in pre-release version, the version typically looks like `3.5.5.dev` and I wanted to make `3.5.5~dev` RPM version out of it, therefore I wanted to make e.g. `test_unit_prerelease` macro to contain the `.dev` suffix

> I'll also note that this is in already in the territory where doing things in Lua with proper program logic will be much easier to both write and read.

Funnily enough, we were forced to use Lua for [c9s](https://gitlab.com/redhat/centos-stream/rpms/ruby/-/blob/stream-ruby-3.3-rhel-9.6.0/macros.rubygems?ref_type=heads#L15), because RPM does not support `%{sub:...}` there. ATM, I don't think it is more readable nor shorter. But admittedly, it could also be written different way ...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3411#discussioncomment-11096807
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/3411/comments/11096807 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241030/b20dc45c/attachment.html>


More information about the Rpm-maint mailing list