Restrict query to spec sections above %files

In Clear Linux OS, all package spec files define their header fields
(and other required sections, like %description) above the first %files
section. Restricting the `rpmspec` queries to sections of %files speeds
up the command significantly, most notably for `texlive`, which has the
largest spec file.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2020-12-14 03:54:17 +00:00
parent e227e8722b
commit d2d8b886bd

View File

@@ -49,9 +49,10 @@ endef
# Query the spec file (or spec files) listed in argument 2 for the field(s)
# specified in argument 1. The fields are derived from the source rpm(s)
# generated by the specs.
# generated by the specs. Queried fields that are declared within the spec file
# must be declared above the first %files section.
define queryspec
rpmspec --define='_vendor clr' --srpm --query --queryformat='$(1)' $(2)
rpmspec --define='_vendor clr' --srpm --query --queryformat='$(1)' <(sed -n '1,/%files/p' $(2))
endef
# If GITOLITE_BASE_URL is defined, sets a repo's push URL for that gitolite