[OS-BUILD PATCHv6 7/11] redhat/Makefile: Cleanup TARBALL target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

redhat/Makefile: Cleanup TARBALL target

The TARBALL target can be cleaned up by using GITID everywhere.  This
results in no changes, so the SINGLE_TARBALL variable can be dropped.

Additional fix: Use GITID directly in create-tarball.sh.  GITID is already
GITID_NORMALIZE so it is safe to replace.

Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -206,18 +206,12 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 # specific values should be set.
 #
 ifeq ("$(DISTRO)", "fedora")
-  # A non-unified tarball means that the tarball is only upstream sources
-  # and the patches get applied as a diff in the spec file
-  SINGLE_TARBALL:=0
   TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
     BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
   endif
 else ifeq ("$(DISTRO)", "centos")
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
-  SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=c$(RHEL_MAJOR)s
   ifndef BUILD_PROFILE
     BUILD_PROFILE:= -p stream
@@ -227,9 +221,6 @@ else ifeq ("$(DISTRO)", "centos")
   endif
   TARFILE_RELEASE:=$(RPMVERSION)
 else
-  # A unified tarball means that the tarball in the srpm contains both the
-  # upstream sources and RHEL specific patches.
-  SINGLE_TARBALL:=1
   RHDISTGIT_BRANCH:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0
   ifndef BUILD_SCRATCH_TARGET
     BUILD_SCRATCH_TARGET:=rhel-$(RHEL_MAJOR).$(RHEL_MINOR).0-test-pesign
@@ -396,11 +387,7 @@ dist-stub-key:
 # force tarball to be regenerated if HEAD changes
 .PHONY:	$(TARBALL)
 $(TARBALL):
-	@if [ $(SINGLE_TARBALL) -eq 1 ]; then \
-		scripts/create-tarball.sh $(GITID) linux-$(RPMVERSION); \
-	else \
-		scripts/create-tarball.sh $(MARKER) linux-$(TARFILE_RELEASE); \
-	fi
+	scripts/create-tarball.sh $(GITID) linux-$(TARFILE_RELEASE)
 
 .PHONY: $(KABI_TARBALL)
 $(KABI_TARBALL):
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -162,13 +162,17 @@ mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
 
 echo "MARKER is $MARKER"
 
-if [ "$SINGLE_TARBALL" = 0 ]; then
+if [ "$DISTRO" == "fedora" ]; then
+	# The tarball in the SRPM contains only the upstream sources.
+
 	# May need to preserve word splitting in EXCLUDE_FILES
 	# shellcheck disable=SC2086
 	git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
 		> ${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
-	# Need an empty file for dist-git compatibility
+	# The tarball in the SRPM contains both upstream sources and OS-specifc
+	# commits.  Even though this is the case, an empty file for dist-git
+	# compatibility is necessary.
 	touch "${SOURCES}/patch-${RPMKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
diff --git a/redhat/scripts/create-tarball.sh b/redhat/scripts/create-tarball.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/create-tarball.sh
+++ b/redhat/scripts/create-tarball.sh
@@ -16,8 +16,7 @@ fi
 
 if [ -f "$TARBALL" ]; then
 	TARID=$(xzcat -qq "$TARBALL" | git get-tar-commit-id 2>/dev/null)
-	GITID_NORMALIZE=$(git log --max-count=1 --pretty=format:%H "$GITID")
-	if [ "${GITID_NORMALIZE}" = "${TARID}" ]; then
+	if [ "${GITID}" = "${TARID}" ]; then
 		echo "$(basename "$TARBALL") unchanged..."
 		exit 0
 	fi
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 b/redhat/self-test/data/centos-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.el7
+++ b/redhat/self-test/data/centos-2585cf9dfaad.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 b/redhat/self-test/data/centos-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 b/redhat/self-test/data/centos-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.el7
+++ b/redhat/self-test/data/centos-78e36f3b0dae.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 b/redhat/self-test/data/centos-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.el7
+++ b/redhat/self-test/data/centos-df0cc57e057f.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25 b/redhat/self-test/data/centos-df0cc57e057f.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-df0cc57e057f.fc25
+++ b/redhat/self-test/data/centos-df0cc57e057f.fc25
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.el7 b/redhat/self-test/data/centos-fce15c45d3fb.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-fce15c45d3fb.el7
+++ b/redhat/self-test/data/centos-fce15c45d3fb.el7
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25 b/redhat/self-test/data/centos-fce15c45d3fb.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/centos-fce15c45d3fb.fc25
+++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25
@@ -57,7 +57,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.el7 b/redhat/self-test/data/fedora-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-2585cf9dfaad.el7
+++ b/redhat/self-test/data/fedora-2585cf9dfaad.el7
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.fc25 b/redhat/self-test/data/fedora-2585cf9dfaad.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-2585cf9dfaad.fc25
+++ b/redhat/self-test/data/fedora-2585cf9dfaad.fc25
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-78e36f3b0dae.el7 b/redhat/self-test/data/fedora-78e36f3b0dae.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-78e36f3b0dae.el7
+++ b/redhat/self-test/data/fedora-78e36f3b0dae.el7
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-78e36f3b0dae.fc25 b/redhat/self-test/data/fedora-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-78e36f3b0dae.fc25
+++ b/redhat/self-test/data/fedora-78e36f3b0dae.fc25
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-df0cc57e057f.el7 b/redhat/self-test/data/fedora-df0cc57e057f.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-df0cc57e057f.el7
+++ b/redhat/self-test/data/fedora-df0cc57e057f.el7
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-df0cc57e057f.fc25 b/redhat/self-test/data/fedora-df0cc57e057f.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-df0cc57e057f.fc25
+++ b/redhat/self-test/data/fedora-df0cc57e057f.fc25
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-fce15c45d3fb.el7 b/redhat/self-test/data/fedora-fce15c45d3fb.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-fce15c45d3fb.el7
+++ b/redhat/self-test/data/fedora-fce15c45d3fb.el7
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/fedora-fce15c45d3fb.fc25 b/redhat/self-test/data/fedora-fce15c45d3fb.fc25
index blahblah..blahblah 100644
--- a/redhat/self-test/data/fedora-fce15c45d3fb.fc25
+++ b/redhat/self-test/data/fedora-fce15c45d3fb.fc25
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.fce15c45d3fbd9f.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=0 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
diff --git a/redhat/self-test/data/rhel-2585cf9dfaad.el7 b/redhat/self-test/data/rhel-2585cf9dfaad.el7
index blahblah..blahblah 100644
--- a/redhat/self-test/data/rhel-2585cf9dfaad.el7
+++ b/redhat/self-test/data/rhel-2585cf9dfaad.el7
@@ -55,7 +55,6 @@ RPMKSUBLEVEL=0
 RPMKVERSION=5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
-SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux