From d2d8b886bde69c4670f1edbefb39ba3218a3bc0f Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Mon, 14 Dec 2020 03:54:17 +0000 Subject: [PATCH] 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 --- Makefile.shared | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.shared b/Makefile.shared index 19288ad..2ccb8e7 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -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