[Rpm-maint] [rpm-software-management/rpm] RFE: Macronized opts for parmaetric macros (i.e. %foo(%{myopts}) ...) (Issue #3440)

Miro Hrončok notifications at github.com
Tue Nov 12 00:12:01 UTC 2024


**Describe the bug**

I'd like to reuse a set of options between several macros.

```
%_options abc
%foo(%{_options}) ...
%bar(%{_options}) ...
%baz(%{_options}) ...
```

Unfortunately, this is not possible with RPM 4.20 or lower. The string is taken literally. Using `%{expand:%{_options}}` makes no difference -- it just defines options for `-e`, `-x`, `-p`...

Similarly, if I use an expression within, all charracters of that expression are taken as literal values (e.g. `foo(%[1 ? "abc" : "def"])` allows all of `-abcdef` but also e.g. `-?`, `-[` or `-"` as option.

**To Reproduce**

```
$ rpm --define '_options abc' --define 'foo(%{_options}) ...' --eval '%foo -a' --eval '%foo -o'
```

**Expected behavior**

```
foo: invalid option -- 'o'
error: Unknown option a in foo(abc)
```

**Output (actual behavior)**

```
foo: invalid option -- 'a'
error: Unknown option a in foo(%{_options})
```

**Environment**
 - OS / Distribution: Fedora 41 or older
 - Version rpm-4.20.0-1.fc41 or older


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3440
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/3440 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241111/9d8c60ba/attachment-0001.html>


More information about the Rpm-maint mailing list