You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yet this seemed horrible so later I went with something like this:
Macros:
%foreach(m:) %{lua:
ifopt.m==niloropt.m=="" thenrpm.expand("%{error:%%foreach requires -m <macro_name>}")
endif#arg<2thenrpm.expand("%{error:%%foreach requires at least one macro value and a template string}")
end-- The string template is the last argumentlocaltemplate=arg[#arg]
fori=1, #arg-1dorpm.define(opt.m.."" ..arg[i])
print(rpm.expand(template))
print("\\n")
rpm.undefine(opt.m)
end
}
%foreachpy() %{foreach-mpython3_pkgversion%{python3_pkgversions} %{quote:%1}}
It works, but it's a bit tedious to use. Particularly, the need to %%%%-escape the %license declaration in files is 🤯 (or else it expands to the License value).
I was wondering if we could have some native mechanism of a foreach block in RPM, that would:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi. In the past, I found myself in a position where I had to do something like this:
For more complex spec snippets, I defined a helper macro:
Yet this seemed horrible so later I went with something like this:
Macros:
Usage:
It works, but it's a bit tedious to use. Particularly, the need to
%%%%-escape the%licensedeclaration in files is 🤯 (or else it expands to the License value).I was wondering if we could have some native mechanism of a foreach block in RPM, that would:
%quoteE.g. I would love to be able to do:
All reactions