|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# Some miscellaneous Fedora-related macros
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# List files matching inclusion globs, excluding files matching exclusion blogs
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# Optional parameters:
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# – -i "<globs>" inclusion globs
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# – -x "<globs>" exclusion globs
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# Globs are space-separated lists of shell globs. Such lists require %{quote:}
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# use for safe rpm argument passing.
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# Alternatively, set the following rpm variables before calling the macro:
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# – “listfiles_include” inclusion globs
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# — “listfiles_exclude” exclusion globs
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# Arguments passed to the macro without flags will be interpreted as inclusion
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
c6773c1 |
# globs.
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
%listfiles(i:x:) %{expand:
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
9deb068 |
%if "%{?-i*}%{expand:%{?listfiles_include}}%*" != ""
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
listfiles_include=$(realpath -e --relative-base=. %{?-i*} %{?listfiles_include} %* | sort -u)
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
9deb068 |
%if "%{?-x*}%{expand:%{?listfiles_exclude}}" != ""
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
while IFS= read -r finc ; do
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
realpath -qe --relative-base=. %{?-x*} %{?listfiles_exclude} \\
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
| sort -u | grep -q "${finc}" || echo "${finc}"
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
done <<< "${listfiles_include}"
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
%else
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
echo "${listfiles_include}"
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
%endif
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
02f4a20 |
%endif
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
}
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# https://github.com/rpm-software-management/rpm/issues/581
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# Write the contents of a list of rpm variables to a macro file.
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# The target file must contain the corresponding anchors.
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# For example %writevars -f myfile foo bar will replace:
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# @@FOO@@ with the rpm evaluation of %{foo} and
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# @@BAR@@ with the rpm evaluation of %{bar}
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
# in myfile
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
%writevars(f:) %{lua:
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
local fedora = require "fedora.common"
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
local macrofile = rpm.expand("%{-f*}")
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
local rpmvars = {}
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
for i = 1, rpm.expand("%#") do
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
table.insert(rpmvars, rpm.expand("%" .. i))
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
end
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
fedora.writevars(macrofile,rpmvars)
|
|
![](https://seccdn.libravatar.org/avatar/f566877593028deb7dc6fc930a2cbbfea5d2f163ef983a6f562b51c0e13fcc5e?s=16&d=retro) |
5335ee5 |
}
|
|
Björn Persson |
3da0ad5 |
|
|
Björn Persson |
3da0ad5 |
# gpgverify verifies signed sources. There is documentation in the script.
|
|
Björn Persson |
3da0ad5 |
%gpgverify %{_rpmconfigdir}/redhat/gpgverify
|