Compare commits

..

4 Commits

Author SHA1 Message Date
Patrick McCarty d2d8b886bd 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>
2020-12-14 04:01:31 +00:00
Patrick McCarty e227e8722b Use %{NVR} queryformat when possible
The `%{NVR}` format is equivalent to `%{NAME}-%{VERSION]-%{RELEASE}`.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-12-14 03:52:58 +00:00
Patrick McCarty b924031ba6 Use parameterized function for most rpmspec commands
The `rpmspec` commands usually specify the same flags aside from the
queryformat and the spec file(s) to query.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-12-14 03:49:30 +00:00
clrbuilder 0981d133b1 Update packages file for version 34080
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2020-12-10 00:07:08 -08:00
4 changed files with 18 additions and 9 deletions
+7 -7
View File
@@ -11,7 +11,7 @@ SHELL = /bin/bash
SPECFILE = $(addsuffix .spec, $(PKG_NAME))
SRPMVERS = $(shell [ ! -f $(SPECFILE) ] || rpmspec -D '_vendor clr' --srpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}\n' $(SPECFILE))
SRPMVERS = $(shell [ ! -f $(SPECFILE) ] || $(call queryspec,%{NVR}\n,$(SPECFILE)))
SRPMFILE = results/$(SRPMVERS).src.rpm
LATEST_RPMS = $(wildcard rpms/*.rpm)
@@ -46,7 +46,7 @@ upstream:
#help spdxcheck: Checks that the package license is a valid SPDX license,
#help or that it is in the exceptions list.
spdxcheck: $(SPECFILE)
@for LICENSE in `rpmspec -D '_vendor clr' --srpm -q --queryformat '%{LICENSE}\n' $(SPECFILE)`; do \
@for LICENSE in `$(call queryspec,%{LICENSE}\n,$(SPECFILE))`; do \
if ! grep -qx "$$LICENSE" $(TOPLVL)/projects/common/licenses-{spdx,exceptions,extra}; then FAIL=yes; echo "ERROR: License '$$LICENSE' is not an allowed SPDX license ID"; fi; \
done; test -z "$$FAIL"
@@ -217,12 +217,12 @@ bump:
git pull --rebase
$(MAKE) bumpnogit
git add $(SPECFILE) release
git commit -a -m "version bump from $(shell rpmspec -D '_vendor clr' --srpm -q --queryformat '%{VERSION}-%{RELEASE}\n' $(SPECFILE)) to `rpmspec -D '_vendor clr' --srpm -q --queryformat '%{VERSION}-%{RELEASE}\n' $(SPECFILE)`"
git commit -a -m "version bump from $(shell $(call queryspec,%{VERSION}-%{RELEASE}\n,$(SPECFILE))) to `$(call queryspec,%{VERSION}-%{RELEASE}\n,$(SPECFILE))`"
#help bumpnogit: Increments the release file by one and does not commit changes.
bumpnogit:
@$(MAKE) spdxcheck
oldrel=$(shell rpmspec -D '_vendor clr' --srpm -q --queryformat '%{RELEASE}\n' $(SPECFILE)); \
oldrel=$(shell $(call queryspec,%{RELEASE}\n,$(SPECFILE))); \
newrel=$$(($$oldrel + 1)); \
sed -i "s/^\(Release[[:blank:]]*:[[:blank:]]*\)$$oldrel$$/\1$$newrel/" $(SPECFILE); \
echo "$$newrel" > release;
@@ -232,7 +232,7 @@ $(__missingsources): sources
# First argument is a Clear Linux build number (e.g. 22000)
define fetch-from-srpm
tmp=$$(mktemp -d -p "."); \
srpm=$$(rpmspec --srpm -q --qf "%{NVR}.src.rpm\n" $(SPECFILE)); \
srpm=$$($(call queryspec,%{NVR}.src.rpm\n,$(SPECFILE))); \
if cd "$$tmp" && ! curl -s -S -f -L -O $(MIRROR_CURL_OPTS) $(DOWNLOAD_MIRROR)/releases/$(1)/clear/source/SRPMS/$$srpm; then \
echo "Failed to download $$srpm from Clear Linux release $(1)." >&2; \
cd .. && rm -rf "$$tmp"; \
@@ -240,7 +240,7 @@ define fetch-from-srpm
fi; \
rpm2cpio $$srpm | cpio --quiet -id; \
cd ..; \
srclist=$$(rpmspec --srpm -q --qf "[%{SOURCE}\n]" $(SPECFILE)); \
srclist=$$($(call queryspec,[%{SOURCE}\n],$(SPECFILE))); \
for s in $$srclist; do \
if ! mv --no-clobber "$$tmp"/$$s .; then \
echo "Missing source file \"$$s\" in $${srpm}." >&2; \
@@ -279,7 +279,7 @@ else
sources:
@$(MAKE) generateupstream; \
[ $$? -eq 0 ] && exit 0; \
nvr="$$(rpmspec --srpm -q --qf '%{NAME}\t%{VERSION}\t%{RELEASE}\n' $(SPECFILE))"; \
nvr="$$($(call queryspec,%{NAME}\t%{VERSION}\t%{RELEASE}\n,$(SPECFILE)))"; \
git -C $(TOPLVL)/projects/common fetch --tags >/dev/null 2>&1; \
latest_builds=$$(git -C $(TOPLVL)/projects/common tag -l | sort -rn); \
for b in $$latest_builds; do \
+8
View File
@@ -47,6 +47,14 @@ define subjectprefix
git config format.subjectPrefix "PATCH $(1)"
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. 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)' <(sed -n '1,/%files/p' $(2))
endef
# If GITOLITE_BASE_URL is defined, sets a repo's push URL for that gitolite
# instance. Accepts one argument: the path to the repo on gitolite. If
# GITOLITE_BASE_URL is not defined, no push URL is set -- the shell's null
+2 -2
View File
@@ -178,13 +178,13 @@ log: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
#help versions: Displays the version of each package in the ./packages tree.
versions: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
@for p in $(addprefix packages/,$(PKGS_LOCAL)); do \
(cd $$p; if ls *.spec &> /dev/null; then rpmspec -q --queryformat '%{NAME}-%{VERSION}\n' *.spec | head -n1; fi) ;\
(cd $$p; if ls *.spec &> /dev/null; then $(call queryspec,%{NAME}-%{VERSION}\n,*.spec) | head -n1; fi) ;\
done
#help releases: Like 'make versions', but also displays the release number.
releases: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
@for p in $(addprefix packages/,$(PKGS_LOCAL)); do \
(cd $$p; if ls *.spec &> /dev/null; then rpmspec -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}\n' *.spec | head -n1; fi) ;\
(cd $$p; if ls *.spec &> /dev/null; then $(call queryspec,%{NVR}\n,*.spec) | head -n1; fi) ;\
done
#help provides: Is used to find out which RPM package provides some file.
+1
View File
@@ -1619,6 +1619,7 @@ gdal
gdb
gdbm
gdk-pixbuf
gdk-pixbuf-xlib
gdl
gdm
geany