From b06f941caa47d320b697c51fab42dd7f1c8e020f Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Fri, 24 May 2024 17:41:23 +0800 Subject: [PATCH] dist: don't parse kernel version unless needed RPM version parsing need to search for git tag, which is slow if the repo is skewed. Skip that if not needed. Signed-off-by: Kairui Song --- dist/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dist/Makefile b/dist/Makefile index 012ca2a3d5c1..31045b44a8b0 100644 --- a/dist/Makefile +++ b/dist/Makefile @@ -86,7 +86,7 @@ $(shell mkdir -p $(WORKDIRS); \ ) ### Build files -KFULLVER := $(shell $(DISTDIR)/scripts/get-version.sh $(GITREF) vr) +KFULLVER = $(shell $(DISTDIR)/scripts/get-version.sh $(GITREF) vr) CONFIGFILE := $(shell $(DISTDIR)/scripts/ls-config-files.sh $(CONFIG)) SPECFILE = $(RPM_SOURCEDIR)/kernel.spec TARNAME = kernel-$(KFULLVER) @@ -146,12 +146,10 @@ endif default: dist-help -$(TARFILE): +dist-tarball: @echo "Generating kernel source tar: $(TARFILE)" - @cd $(TOPDIR); git archive $(GITREF) $(TOPDIR) --format=tar.gz --prefix=$(TARNAME)/ --output $(TARFILE) - -dist-tarball: $(TARFILE) @echo "$(TARFILE)" + @cd $(TOPDIR); git archive $(GITREF) $(TOPDIR) --format=tar.gz --prefix=$(TARNAME)/ --output $(TARFILE) $(CONFIGFILE): $(DISTFILES) @echo "Generating kernel config style '$(CONFIG)'" @@ -186,7 +184,7 @@ $(SPECFILE): always-rebuild dist-configs dist-specfile: $(SPECFILE) @echo "$(SPECFILE)" -dist-sources: dist-configs $(TARFILE) $(DISTSOURCES) $(DISTKABIS) $(SPECFILE) +dist-sources: dist-configs dist-tarball $(DISTSOURCES) $(DISTKABIS) $(SPECFILE) @cp $(DISTSOURCES) $(DISTKABIS) $(RPM_SOURCEDIR) define DO_RPMBUILD