Particular use case: I'd like to be able to query a spec file for the list of 
its patches. Currently (on Fedora 39's 4.19.1) this is only possible using 
`rpmspec --shell` but it requires parsing the output:

```
❯ echo '%patches' | rpmspec --shell ./*.spec
RPM version 4.19.1.1 macro shell
> %patches
'/home/michel/src/fedora/pkgs/other/slurm/slurm_release_version.patch' 
'/home/michel/src/fedora/pkgs/other/slurm/slurm_check_version.patch' 
'/home/michel/src/fedora/pkgs/other/slurm/slurm_html_doc_path.patch' 
'/home/michel/src/fedora/pkgs/other/slurm/slurm_perlapi_rpaths.patch' 
'/home/michel/src/fedora/pkgs/other/slurm/slurm_runtime_linking.patch' 
'/home/michel/src/fedora/pkgs/other/slurm/slurm_to_python3.patch'
> ⏎ 
```

without shell, `rpmspec` only allows querying query tags e.g.

```
$ rpmspec --srpm --query --qf '%{name}\n' ./*.spec
slurm

$ rpmspec --srpm --query --qf '%{patches}\n' ./*.spec
error: incorrect format: unknown tag: "patches"
```

While `rpm` allows evaluating anything but only those define by shipped macros, 
not definitions that are spec file specific; `rpmspec` does seem to have a `-E` 
eval option but it is undocumented and does not seem to work

```
$ rpm -E '%_sysconfdir'
/etc

$ rpmspec -q -E '%patches' ./*.spec
error: lua script failed: attempt to index a nil value
```


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

Message ID: <rpm-software-management/rpm/repo-discussions/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to