[OS-BUILD PATCH 17/18] redhat/Makefile: Add RHTEST

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add RHTEST

For a long time we have wanted a mechanism by which we could do a 'test
run' of Makefile targets.  Make has built-in options '-n, --just-print,
--dry-run, --recon' that can be added on the command line that allow users
to show the output for commands but not execute them.

However, as explained in the Make manual [1], Makefile lines beginning
with a '+' will still be executed if '-n' is specified.

Add a RHTEST variable that is set to 1 if '-n' (or any of the other
'dry run' parameters) is added to the make command.  Modify the scripts to
return without executing if RHTEST is set.

[1] 
https://www.gnu.org/software/automake/manual/html_node/Debugging-Make-Rules.html

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -33,6 +33,12 @@ SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
 SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
 SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
+ifneq (,$(findstring n,$(MAKEFLAGS)))
+  # Do not set RHTEST on the command line. Use the make command built-in 
options
+  # -n, --just-print, --dry-run, --recon on the command line.
+  RHTEST=1
+endif
+
 LANG=C
 
 ifndef RHSELFTESTDATA
diff --git a/redhat/configs/build_configs.sh b/redhat/configs/build_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/build_configs.sh
+++ b/redhat/configs/build_configs.sh
@@ -4,6 +4,8 @@
 # and debug to form the necessary 
$PACKAGE_NAME--.config
 # files for building RHEL kernels, based on the contents of a control file
 
+test -n "$RHTEST" && exit 0
+
 PACKAGE_NAME="${1:-kernel}" # defines the package name used
 if [ -z "$2" ]; then
cat flavors > .flavors
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -2,6 +2,8 @@
 
 # Adjusts the configuration options to build the variants correctly
 
+test -n "$RHTEST" && exit 0
+
 DEBUGBUILDSENABLED=$1
 if [ -z "$DEBUGBUILDSENABLED" ]; then
exit 1
diff --git a/redhat/configs/process_configs.sh 
b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -6,6 +6,8 @@
 # Globally disable suggestion of appending '|| exit' or '|| return' to 
cd/pushd/popd commands
 # shellcheck disable=SC2164
 
+test -n "$RHTEST" && exit 0
+
 usage()
 {
# alphabetical order please

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 12/18] redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

Change DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED so that readers
understand it is passed into the spec file.

Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -17,10 +17,10 @@ UPSTREAM=$(git rev-parse -q --verify 
origin/"${UPSTREAM_BRANCH}" || \
 if [ "$SNAPSHOT" = 0 ]; then
# This is based off a tag on Linus's tree (e.g. v5.5 or v5.5-rc5).
# Two kernels are built, one with debug configuration and one without.
-   DEBUG_BUILDS_ENABLED=1
+   SPECDEBUG_BUILDS_ENABLED=1
 else
# All kernels are built with debug configurations.
-   DEBUG_BUILDS_ENABLED=0
+   SPECDEBUG_BUILDS_ENABLED=0
 fi
 
 if [ -n "$BUILDID" ]; then
@@ -67,7 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
-   s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
+   s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -85,7 +85,7 @@ Summary: The Linux kernel
 # Set debugbuildsenabled to 0 to not build a separate debug kernel, but
 #  to build the base kernel using the debug configuration. (Specifying
 #  the --with-release option overrides this setting.)
-%define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
+%define debugbuildsenabled %%SPECDEBUG_BUILDS_ENABLED%%
 
 %global distro_build %%SPECDISTROBUILD%%
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 4/18] redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

Change RPMKVERSION to SPECVERSION so that readers understand it is passed
into the spec file.

Rename RPMKVERSION to SPECKVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -50,7 +50,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
   else echo rpm; fi)
 
 MACH:=$(shell uname -m)
-RPMKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
+SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
@@ -134,15 +134,15 @@ endif
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -60,7 +60,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/r $SOURCES/$CHANGELOG
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
-   s/%%RPMKVERSION%%/$RPMKVERSION/
+   s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${RPMKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# 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
+   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
# 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
+   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -127,10 +127,10 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 
 %define specversion %%SPECVERSION%%
-%define patchversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define patchversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 %define pkgrelease %%PKGRELEASE%%
 
 # This is needed to do merge window version magic
@@ -1357,7 +1357,7 @@ ApplyPatch()
 exit 1
   fi
   if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; 
then
-if [ "${patch:0:8}" != "patch-%%RPMKVERSION%%." ] ; then
+if [ "${patch:0:8}" != "patch-%%SPECKVERSION%%." ] ; then
   echo "ERROR: Patch  $patch  not listed as a source patch in specfile"
   exit 1

[OS-BUILD PATCH 3/18] redhat/Makefile: Rename KVERSION to SPECVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename KVERSION to SPECVERSION

KVERSION is passed into the spec file and is easy to confuse with the
kernel KVERSION.  Change the name to SPECVERSION so that readers
understand it is the %Version field of the specfile.

As a result RPMKSUBLEVEL can be dropped from genspec.sh.

Rename KVERSION to SPECVERSION and use it in the specfile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(KVERSION)
-UPSTREAM_TARBALL_NAME:=$(KVERSION)
+MARKER:=v$(SPECVERSION)
+UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
   endif
   PREBUILD:=
 endif
@@ -204,13 +204,13 @@ else
   SNAPSHOT:=0
 endif
 
-KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
+RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -352,11 +352,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
+   ./process_configs.sh -z "$(SPECVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(SPECVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(KVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -18,7 +18,7 @@ else
 fi
 
 for i in kernel-*-"$FLAVOR".config; do
-   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
+   NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -73,4 +73,4 @@ or,
   dist-kernelversion:
 # deprecated in 5.17.0
 @echo "WARNING: This target will be removed in a later release."
-@echo $(KVERSION)-$(DISTRO_BUILD)
+@echo $(SPECVERSION)-$(DISTRO_BUILD)
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -62,7 +62,6 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%RPMKVERSION%%/$RPMKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
-   s/%%RPMKSUBLEVEL%%/$RPMKSUBLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -71,6 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -129,7 +129,7 @@ Summary: The Linux kernel
 # The kernel tarball/base version
 %define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
 
-%define rpmversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%.%%

[OS-BUILD PATCH 11/18] redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

Change DISTRO_BUILD to SPECDISTROBUILD so that readers understand it is passed
into the spec file.

Rename DISTRO_BUILD to SPECDISTROBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -205,10 +205,10 @@ else
 endif
 
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+SPECDISTROBUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
 RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -65,7 +65,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
-   s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
+   s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -87,7 +87,7 @@ Summary: The Linux kernel
 #  the --with-release option overrides this setting.)
 %define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
 
-%global distro_build %%DISTRO_BUILD%%
+%global distro_build %%SPECDISTROBUILD%%
 
 %if 0%{?fedora}
 %define secure_boot_arch x86_64
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
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
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
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.fc25 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
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
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc0.78e36f3b0dae586.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc0.78e36f3b0dae586.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- 

[OS-BUILD PATCH 18/18] redhat/self-test: Add test to verify Makefile declarations.

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify Makefile declarations.

The Makefiles have been organized such that only Makefile.variables
contain external variables that can be set on the command line, and
the Makefile only contains variables that can set within the Makefile
itself.

Add a test to verify these Makefile declarations.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/self-test/3001-Makefile-contents.bats 
b/redhat/self-test/3001-Makefile-contents.bats
new file mode 100755
index blahblah..blahblah 100755
--- /dev/null
+++ b/redhat/self-test/3001-Makefile-contents.bats
@@ -0,0 +1,17 @@
+#!/usr/bin/env bats
+
+@test "Makefile variable declarations" {
+   # By design, only the Makefile.variables file should have ?= 
declarations
+
+   value=$(git grep "?=" Makefile.variables | wc -l)
+   if [ $value -eq 0 ]; then
+   echo "Test failed: No ?= variables found in Makefile.variables"
+   exit 1
+   fi
+
+   value=$(git grep "?=" Makefile | wc -l)
+   if [ $value -gt 0 ]; then
+   echo "Test failed: Makefile should not ?= declarations."
+   exit 1
+   fi
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 6/18] redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

Change RPMKSUBLEVEL to SPECSUBLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKSUBLEVEL to SPECKSUBLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -52,7 +52,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
-RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
+SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
@@ -140,7 +140,7 @@ ifneq ($(RPMKEXTRAVERSION),)
   UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
-  ifeq ($(RPMKSUBLEVEL),0)
+  ifeq ($(SPECKSUBLEVEL),0)
 MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/dat

Re: [OS-BUILD PATCH 0/18] redhat: test updates

2022-04-22 Thread Prarit Bhargava

On 4/22/22 12:38, Prarit Bhargava (via Email Bridge) wrote:

From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727



Damn Email Bridge.  I really thought Depends was going to work on ARK. 
:/  The commit list here is only the last two commits.  The first 16 are 
from !1727.


Sorry 'bout the noise everyone,

P.


Add a test to verify Makefile declarations, and add the RHTEST variable.
The latter of these changes allows users to execute make commands
with -n, --dry-run, and other "test" commands.

Signed-off-by: Prarit Bhargava 

---
  redhat/configs/build_configs.sh |2 +
  redhat/configs/generate_all_configs.sh  |4 +-
  redhat/configs/process_configs.sh   |2 +
  redhat/docs/makefile-changes.rst|8 +-
  redhat/scripts/create-tarball.sh|2 +-
  redhat/self-test/data/centos-2585cf9dfaad.el7   |   21 ++-
  redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |   24 ++--
  redhat/self-test/data/centos-2585cf9dfaad.fc25  |   21 ++-
  redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |   24 ++--
  redhat/self-test/data/centos-78e36f3b0dae.el7   |   21 ++-
  redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |   24 ++--
  redhat/self-test/data/centos-78e36f3b0dae.fc25  |   21 ++-
  redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |   24 ++--
  redhat/self-test/data/centos-df0cc57e057f.el7   |   21 ++-
  redhat/self-test/data/centos-df0cc57e057f.el7.spec  |   24 ++--
  redhat/self-test/data/centos-df0cc57e057f.fc25  |   21 ++-
  redhat/self-test/data/centos-df0cc57e057f.fc25.spec |   24 ++--
  redhat/self-test/data/centos-fce15c45d3fb.el7   |   21 ++-
  redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |   24 ++--
  redhat/self-test/data/centos-fce15c45d3fb.fc25  |   21 ++-
  redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |   24 ++--
  redhat/self-test/data/fedora-2585cf9dfaad.el7   |   21 ++-
  redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |   24 ++--
  redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   21 ++-
  redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |   24 ++--
  redhat/self-test/data/fedora-78e36f3b0dae.el7   |   21 ++-
  redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |   24 ++--
  redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   21 ++-
  redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |   24 ++--
  redhat/self-test/data/fedora-df0cc57e057f.el7   |   21 ++-
  redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |   24 ++--
  redhat/self-test/data/fedora-df0cc57e057f.fc25  |   21 ++-
  redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |   24 ++--
  redhat/self-test/data/fedora-fce15c45d3fb.el7   |   21 ++-
  redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |   24 ++--
  redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   21 ++-
  redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |   24 ++--
  redhat/self-test/data/rhel-2585cf9dfaad.el7 |   21 ++-
  redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|   24 ++--
  redhat/self-test/data/rhel-2585cf9dfaad.fc25|   21 ++-
  redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |   24 ++--
  redhat/self-test/data/rhel-78e36f3b0dae.el7 |   21 ++-
  redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|   24 ++--
  redhat/self-test/data/rhel-78e36f3b0dae.fc25|   21 ++-
  redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |   24 ++--
  redhat/self-test/data/rhel-df0cc57e057f.el7 |   21 ++-
  redhat/self-test/data/rhel-df0cc57e057f.el7.spec|   24 ++--
  redhat/self-test/data/rhel-df0cc57e057f.fc25|   21 ++-
  redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |   24 ++--
  redhat/self-test/data/rhel-fce15c45d3fb.el7 |   21 ++-
  redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|   24 ++--
  redhat/self-test/data/rhel-fce15c45d3fb.fc25|   21 ++-
  redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |   24 ++--
  redhat/self-test/1006-verify-SPEC-variables.bats|   24 
  redhat/self-test/3001-Makefile-contents.bats|   17 +++
  redhat/Makefile |  108 +++
  redhat/Makefile.variables   |2 +-
  redhat/genspec.sh   |   55 +
  redhat/kernel.spec.template |   56 +-
  59 files changed, 754 insertions(+), 606 deletions(-)


___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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/archiv

[OS-BUILD PATCH 9/18] redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

Change BUILDID_DEFINE to SPECBUILDID so that readers understand it is passed
into the spec file.

Rename BUILDID_DEFINE to SPECBUILDID.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -23,9 +23,9 @@ else
 fi
 
 if [ -n "$BUILDID" ]; then
-   BUILDID_DEFINE=$(printf "%%define buildid %s" "$BUILDID")
+   SPECBUILDID=$(printf "%%define buildid %s" "$BUILDID")
 else
-   BUILDID_DEFINE="# define buildid .local"
+   SPECBUILDID="# define buildid .local"
 fi
 
 EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
@@ -59,7 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
/%%SPECCHANGELOG%%/d
-   s/%%BUILDID%%/$BUILDID_DEFINE/
+   s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -117,7 +117,7 @@ Summary: The Linux kernel
 # for parallel xz processes, replace with 1 to go back to single process
 %endif
 
-%%BUILDID%%
+%%SPECBUILDID%%
 
 
 %if 0%{?fedora}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 15/18] redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

INCLUDE_FEDORA_FILES, INCLUDE_RHEL_FILES, and RELEASED_KERNEL are
specified in Makefile.variables as they can be set in userspace.

Create duplicate entries for these variables that begin with SPEC.  This
will make debugging easier and indicate that the variables are passed into
the spec file.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -26,6 +26,12 @@ ifdef SINGLE_TARBALL
 endif
 
 include Makefile.variables
+# These entries are 'duplicates' of variables specified in Makefile.variables
+# that are used in the SPEC file.  Specifying these with a SPEC prefix 
indicates
+# that the value is passed through to the spec file.
+SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
+SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
+SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
 LANG=C
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -66,10 +66,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
-   s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
+   s/%%SPECRELEASED_KERNEL%%/$SPECRELEASED_KERNEL/
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
-   s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
-   s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
+   s/%%SPECINCLUDE_FEDORA_FILES%%/$SPECINCLUDE_FEDORA_FILES/
+   s/%%SPECINCLUDE_RHEL_FILES%%/$SPECINCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -4,9 +4,9 @@
 # here before the %%install macro is pre-built.
 
 # Include Fedora files
-%global include_fedora %%INCLUDE_FEDORA_FILES%%
+%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
 # Include RHEL files
-%global include_rhel %%INCLUDE_RHEL_FILES%%
+%global include_rhel %%SPECINCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
 %global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
@@ -77,7 +77,7 @@ Summary: The Linux kernel
 #  kernel release. (This includes prepatch or "rc" releases.)
 # Set released_kernel to 0 when the upstream source tarball contains an
 #  unreleased kernel development snapshot.
-%global released_kernel %%RELEASED_KERNEL%%
+%global released_kernel %%SPECRELEASED_KERNEL%%
 
 # Set debugbuildsenabled to 1 to build separate base and debug kernels
 #  (on supported architectures). The kernel-debug-* subpackages will
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
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
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
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
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
@@ -56,11 +56,14 @@ SPECBUILD=0.rc0.78e36f3b0dae586.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.17.0-0.rc0.78e36f3

[OS-BUILD PATCH 10/18] redhat/Makefile: Rename PKGRELEASE to SPECBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename PKGRELEASE to SPECBUILD

PKGRELEASE is a confusing variable name, and it really is the BUILD string
for the specfile.

Rename PKGRELEASE to SPECBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -209,8 +209,8 @@ DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 
KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
-PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
+SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
+RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -620,9 +620,9 @@ dist-fedora-release-push: dist-fedora-release
 dist-vr-check:
@# builds may include a s390x+zfcpdump arch build.  UTS_RELEASE can 
only have a
@# version-release string with max 64 chars.  The version-release for 
s390x+zfcpdump
-   @# is 29 characters, leaving a maximum of 35 characters for PKGRELEASE.
-   @if [ $$(echo -n $(PKGRELEASE) | wc -c) -gt 35 ]; then \
-   echo "PKGRELEASE ($(PKGRELEASE)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
+   @# is 29 characters, leaving a maximum of 35 characters for SPECBUILD.
+   @if [ $$(echo -n $(SPECBUILD) | wc -c) -gt 35 ]; then \
+   echo "SPECBUILD ($(SPECBUILD)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
exit 1; \
fi
 
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -100,7 +100,7 @@ BUILD ?=
 
 # Builds may include a s390x+zfcpdump arch build, which results in the build
 # failing because the UTS_RELEASE field exceeded 64 chars.  This variable can
-# be set to 1 to decrease the kernel UTS_RELEASE and PKGRELEASE by 11 
characters
+# be set to 1 to decrease the kernel UTS_RELEASE and SPECBUILD by 11 characters
 # (MMDDgit).
 PREBUILD_GIT_ONLY ?=
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2153
 
 LAST_MARKER=$(cat "${REDHAT}"/marker)
 clogf="$SOURCES/changelog"
@@ -62,7 +63,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
-   s/%%PKGRELEASE%%/$PKGRELEASE/
+   s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -131,7 +131,7 @@ Summary: The Linux kernel
 
 %define specversion %%SPECVERSION%%
 %define patchversion %%SPECKVERSION%%.%%SPECKPATCHLEVEL%%
-%define pkgrelease %%PKGRELEASE%%
+%define pkgrelease %%SPECBUILD%%
 
 # This is needed to do merge window version magic
 %define patchlevel %%SPECKPATCHLEVEL%%
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
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.el7 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
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
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.fc25 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPE

[OS-BUILD PATCH 7/18] redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

Change RPMKEXTRAVERSION to SPECEXTRAVERSION so that readers understand it is 
passed
into the spec file.

Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -53,7 +53,7 @@ MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
-RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
+SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
   BUILD:=$(RHEL_RELEASE)
@@ -131,13 +131,13 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and SPECKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
-ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
-  KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
+ifneq ($(SPECKEXTRAVERSION),)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
+  KEXTRAVERSION:=$(shell echo $(SPECKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(SPECKSUBLEVEL),0)
@@ -179,7 +179,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 # been updated but we still need something that works for
 # packaging. Fix this by bumping the patch level and marking
 # this as rc0
-ifeq ($(RPMKEXTRAVERSION),)
+ifeq ($(SPECKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
   SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHS

[OS-BUILD PATCH 13/18] redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

Change PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG so that readers
understand it is passed into the spec file.

Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -40,7 +40,7 @@ EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
 
 # If PATCHLIST_URL is not set to "none", generate Patchlist.changelog file that
 # holds the shas and commits not included upstream and git commit url.
-PATCHLIST_CHANGELOG=0
+SPECPATCHLIST_CHANGELOG=0
 if [ "$PATCHLIST_URL" != "none" ]; then
# sed convert
#  
@@ -53,7 +53,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. 
$EXCLUDE_FILES | \
sed "s!^\([^ ]*\)!$PATCHLIST_URL/\1\n &!; s!\$!\n!" \
> "$SOURCES"/Patchlist.changelog
-   PATCHLIST_CHANGELOG=1
+   SPECPATCHLIST_CHANGELOG=1
 fi
 
 test -f "$SOURCES/$SPECFILE" &&
@@ -70,7 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
-   s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -8,7 +8,7 @@
 # Include RHEL files
 %global include_rhel %%INCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
-%global patchlist_changelog %%PATCHLIST_CHANGELOG%%
+%global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
 # Disable LTO in userspace packages.
 %global _lto_cflags %{nil}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 5/18] redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

Change RPMKPATCHLEVEL to SPECPATCHLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -51,7 +51,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
-RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
+SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
@@ -131,18 +131,18 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -182,7 +182,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 ifeq ($(RPMKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
-  RPMKPATCHLEVEL:=$(shell expr $(RPMKPATCHLEVEL) + 1)
+  SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
 endif
 ifndef PREBUILD_GIT_ONLY
   ifneq ($(filter $(MAKECMDGOALS),dist-git-test dist-git),)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -61,7 +61,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
-   s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
+   s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${SPECKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}-redhat.patch
 else
# 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-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -127,14 +127,14 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kv

[OS-BUILD PATCH 8/18] redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

Change CHANGELOG to SPECCHANGELOG so that readers understand it is passed
into the spec file.  While the CHANGELOG does have use other than in the
spec file it is useful to know that the string is used in the spec file.

Rename CHANGELOG to SPECKCHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -69,7 +69,7 @@ RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-CHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
 CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr 
$(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
@@ -460,14 +460,14 @@ dist-buildreq-check: setup-source
 
 setup-source: dist-git-version-check dist-clean-sources
@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
-   @if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
-   echo "Creating $(CHANGELOG) as copy of $(CHANGELOG_PREV)"; \
-   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \
+   @if [ ! -e  $(REDHAT)/$(SPECCHANGELOG) ]; then \
+   echo "Creating $(SPECCHANGELOG) as copy of $(CHANGELOG_PREV)"; \
+   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(SPECCHANGELOG); \
fi
@if [ -z "$(RHSELFTESTDATA)" ]; then \
-   cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG); \
+   cp $(REDHAT)/$(SPECCHANGELOG) $(SOURCES)/$(SPECCHANGELOG); \
else \
-   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(CHANGELOG); \
+   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(SPECCHANGELOG); 
\
fi
@if [ -z "$(PATCHLIST_URL)" ]; then \
echo "Error: PATCHLIST_URL must be set (to 'none' or any URL)"; 
\
@@ -566,19 +566,19 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
-   @$(GIT) add $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+   @$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(SPECCHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@# if neither changelog nor marker was updated, skip bumping a release
@$(GIT) update-index -q --really-refresh
@if $(GIT) diff-index --quiet HEAD; then \
echo "Nothing changed, skipping updates"; \
else \
-   $(GIT) checkout -- $(REDHAT)/$(CHANGELOG); \
+   $(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
$(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) 
$(__ZSTREAM) $(BUMP_RELEASE); \
$(MAKE) dist-release-finish; \
fi
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -57,8 +57,8 @@ fi
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   /%%CHANGELOG%%/r $SOURCES/$CHANGELOG
-   /%%CHANGELOG%%/d
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
@@ -124,7 +124,7 @@ fi
 # This means we need to zap entries that are already present in the changelog.
 if [ "$MARKER" != "$LAST_MARKER" ]; then
# awk trick to get all unique lines
-   awk '!seen[$0]++' "$SOURCES/$CHANGELOG" "$clogf" > "$clogf.unique"
+   awk '!seen[$0]++' "$SOURCES/$SPECCHANGELOG" "$clogf" > "$clogf.unique"
# sed trick to get the end of the changelog minus the line
sed -e '1,/# END OF CHANGELOG/ d' "$clogf.unique" > "$clogf.tmp"
# Add an explicit entry to indicate a rebase.
@@ -157,8 +157,8 @@ if [ "$LENGTH" = 0 ]; then
rm -f "$clogf.rev"; touch "$clogf.rev"
 fi
 
-cat "$clogf.rev" "$SOURCES/$CHANGELOG" > "$clogf.full"
-mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
+cat "$clogf.rev" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
+mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 echo "MARKER is $MARKER"
 
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.templ

[OS-BUILD PATCH 1/18] redhat/Makefile: Use KVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use KVERSION

Use KVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+MARKER:=v$(KVERSION)
+UPSTREAM_TARBALL_NAME:=$(KVERSION)
   endif
   PREBUILD:=
 endif
@@ -210,7 +210,7 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
+RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 0/18] redhat: test updates

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727

Add a test to verify Makefile declarations, and add the RHTEST variable.
The latter of these changes allows users to execute make commands
with -n, --dry-run, and other "test" commands.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/build_configs.sh |2 +
 redhat/configs/generate_all_configs.sh  |4 +-
 redhat/configs/process_configs.sh   |2 +
 redhat/docs/makefile-changes.rst|8 +-
 redhat/scripts/create-tarball.sh|2 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |   24 ++--
 redhat/self-test/1006-verify-SPEC-variables.bats|   24 
 redhat/self-test/3001-Makefile-contents.bats|   17 +++
 redhat/Makefile |  108 +++
 redhat/Makefile.variables   |2 +-
 redhat/genspec.sh   |   55 +
 redhat/kernel.spec.template |   56 +-
 59 files changed, 754 insertions(+), 606 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 14/18] redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

Change TARFILE_RELEASE to SPECTARFILE_RELEASE so that readers
understand it is passed into the spec file.

Rename TARFILE_RELEASE to SPECTARFILE_RELEASE.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -220,7 +220,7 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 #
 ifeq ("$(DISTRO)", "fedora")
   SINGLE_TARBALL:=0
-  TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
+  SPECTARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
@@ -234,21 +234,21 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 else
   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
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
   BUILD_TARGET:=--scratch $(BUILD_SCRATCH_TARGET)
 endif
 
-TARFILE:=linux-$(TARFILE_RELEASE).tar.xz
+TARFILE:=linux-$(SPECTARFILE_RELEASE).tar.xz
 TARBALL:=$(REDHAT)/$(TARFILE)
 
 include Makefile.rhpkg
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -72,7 +72,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
-   s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+   s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -692,7 +692,7 @@ BuildRequires: lld
 # exact git commit you can run
 #
 # xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-%%TARFILE_RELEASE%%.tar.xz
+Source0: linux-%%SPECTARFILE_RELEASE%%.tar.xz
 
 Source1: Makefile.rhelver
 
@@ -1384,8 +1384,8 @@ ApplyOptionalPatch()
   fi
 }
 
-%setup -q -n kernel-%%TARFILE_RELEASE%% -c
-mv linux-%%TARFILE_RELEASE%% linux-%{KVERREL}
+%setup -q -n kernel-%%SPECTARFILE_RELEASE%% -c
+mv linux-%%SPECTARFILE_RELEASE%% linux-%{KVERREL}
 
 cd linux-%{KVERREL}
 cp -a %{SOURCE1} .
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
@@ -27,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$SPECTARFILE_RELEASE"/ --format=tar "$_GITID" | 
xz $XZ_OPTIONS $XZ_THREADS > "$TARBALL";
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
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
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
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
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

[OS-BUILD PATCH 16/18] redhat/self-test: Add test to verify SPEC variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify SPEC variables

This test looks at the spec file variable replacement code in
redhat/genspec.sh and confirms that each variable begins with "SPEC".

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -46,6 +46,12 @@ external scripts.  Variables in this file should be 
considered stable.
 Variables still may be deprecated and will follow the guidelines in
 "Deprecating variables and targets" section below.
 
+Variable Naming
+===
+
+Variables names prefixed with SPEC indicate that the variable is used
+in redhat/kernel.spec.template (see redhat/genspec.sh).
+
 Deprecating variables and targets
 =
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -56,6 +56,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
SPECPATCHLIST_CHANGELOG=1
 fi
 
+# self-test begin
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
@@ -73,6 +74,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+# self-test end
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
diff --git a/redhat/self-test/1006-verify-SPEC-variables.bats 
b/redhat/self-test/1006-verify-SPEC-variables.bats
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/self-test/1006-verify-SPEC-variables.bats
@@ -0,0 +1,24 @@
+#!/usr/bin/env bats
+
+@test "verify SPEC variables" {
+# This test looks at the spec file variable replacement code in
+# redhat/genspec.sh and confirms that each variable begins with "SPEC".
+
+# This looks at the code and replaces each / with a new-line character, removes
+# any whitespace and entry entries beginning with valid "%%SPEC" or $"SPEC".
+# "$SOURCES" lines are also okay as it is used to point to the changelog and
+# the specfile.
+awk '/# self-test begin/, /# self-test end/' $BATS_TEST_DIRNAME/../genspec.sh 
| grep -v "^#" | tr "/" "\n" | tr -d "\"" | sed -r '/^\s*$/d' | grep -v 
"%%SPEC" | grep -v "\$SPEC" | grep -v "\$SOURCES" | while read LINE
+do
+   case $(echo $LINE | xargs) in
+   s) ;;
+   d) ;;
+#"sed -i -e") ;;
+   *)
+   echo " "
+   echo "ERROR: Variables passed between genspec.sh and the spec 
file must begin with %%SPEC or \$SPEC."
+   exit 1
+   ;;
+   esac
+done
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 12/16] redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED

Change DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED so that readers
understand it is passed into the spec file.

Rename DEBUG_BUILDS_ENABLED to SPECDEBUG_BUILDS_ENABLED.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -17,10 +17,10 @@ UPSTREAM=$(git rev-parse -q --verify 
origin/"${UPSTREAM_BRANCH}" || \
 if [ "$SNAPSHOT" = 0 ]; then
# This is based off a tag on Linus's tree (e.g. v5.5 or v5.5-rc5).
# Two kernels are built, one with debug configuration and one without.
-   DEBUG_BUILDS_ENABLED=1
+   SPECDEBUG_BUILDS_ENABLED=1
 else
# All kernels are built with debug configurations.
-   DEBUG_BUILDS_ENABLED=0
+   SPECDEBUG_BUILDS_ENABLED=0
 fi
 
 if [ -n "$BUILDID" ]; then
@@ -67,7 +67,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
-   s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
+   s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -85,7 +85,7 @@ Summary: The Linux kernel
 # Set debugbuildsenabled to 0 to not build a separate debug kernel, but
 #  to build the base kernel using the debug configuration. (Specifying
 #  the --with-release option overrides this setting.)
-%define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
+%define debugbuildsenabled %%SPECDEBUG_BUILDS_ENABLED%%
 
 %global distro_build %%SPECDISTROBUILD%%
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 8/16] redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename CHANGELOG to SPECCHANGELOG

Change CHANGELOG to SPECCHANGELOG so that readers understand it is passed
into the spec file.  While the CHANGELOG does have use other than in the
spec file it is useful to know that the string is used in the spec file.

Rename CHANGELOG to SPECKCHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -69,7 +69,7 @@ RPM:=$(REDHAT)/rpm
 SRPMS:=$(RPM)/SRPMS
 SOURCES:=$(RPM)/SOURCES
 TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
-CHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
+SPECCHANGELOG:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(RHEL_MINOR)
 CHANGELOG_PREV:=$(PACKAGE_NAME).changelog-$(RHEL_MAJOR).$(shell expr 
$(RHEL_MINOR) - 1)
 ARCH_LIST=aarch64 ppc64le s390x x86_64
 
@@ -460,14 +460,14 @@ dist-buildreq-check: setup-source
 
 setup-source: dist-git-version-check dist-clean-sources
@cp $(REDHAT)/$(SPECFILE).template $(SOURCES)/$(SPECFILE)
-   @if [ ! -e  $(REDHAT)/$(CHANGELOG) ]; then \
-   echo "Creating $(CHANGELOG) as copy of $(CHANGELOG_PREV)"; \
-   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \
+   @if [ ! -e  $(REDHAT)/$(SPECCHANGELOG) ]; then \
+   echo "Creating $(SPECCHANGELOG) as copy of $(CHANGELOG_PREV)"; \
+   cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(SPECCHANGELOG); \
fi
@if [ -z "$(RHSELFTESTDATA)" ]; then \
-   cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG); \
+   cp $(REDHAT)/$(SPECCHANGELOG) $(SOURCES)/$(SPECCHANGELOG); \
else \
-   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(CHANGELOG); \
+   echo "Mon Mar 28 2022 Fedora Kernel Team 
 [$(RPMVERSION)]" > $(SOURCES)/$(SPECCHANGELOG); 
\
fi
@if [ -z "$(PATCHLIST_URL)" ]; then \
echo "Error: PATCHLIST_URL must be set (to 'none' or any URL)"; 
\
@@ -566,19 +566,19 @@ dist-rpm-baseonly: dist-sources do-rpmbuild
 
 # unless you know what you're doing, you don't want to use the next four ones
 dist-release-finish: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
-   @$(GIT) add $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
+   @$(GIT) add $(REDHAT)/$(SPECCHANGELOG)
@$(GIT) add $(REDHAT)/marker
-   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
+   @$(GIT) commit -s ../Makefile.rhelver $(REDHAT)/marker 
$(REDHAT)/$(SPECCHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] 
$(PACKAGE_NAME)-$(RPMVERSION)"
 dist-release-changed: setup-source
-   @cp $(SOURCES)/$(CHANGELOG) $(REDHAT)/$(CHANGELOG)
+   @cp $(SOURCES)/$(SPECCHANGELOG) $(REDHAT)/$(SPECCHANGELOG)
@echo $(MARKER) > $(REDHAT)/marker
@# if neither changelog nor marker was updated, skip bumping a release
@$(GIT) update-index -q --really-refresh
@if $(GIT) diff-index --quiet HEAD; then \
echo "Nothing changed, skipping updates"; \
else \
-   $(GIT) checkout -- $(REDHAT)/$(CHANGELOG); \
+   $(GIT) checkout -- $(REDHAT)/$(SPECCHANGELOG); \
$(REDHAT)/scripts/new_release.sh $(REDHAT) $(__YSTREAM) 
$(__ZSTREAM) $(BUMP_RELEASE); \
$(MAKE) dist-release-finish; \
fi
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -57,8 +57,8 @@ fi
 
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
-   /%%CHANGELOG%%/r $SOURCES/$CHANGELOG
-   /%%CHANGELOG%%/d
+   /%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
+   /%%SPECCHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
@@ -124,7 +124,7 @@ fi
 # This means we need to zap entries that are already present in the changelog.
 if [ "$MARKER" != "$LAST_MARKER" ]; then
# awk trick to get all unique lines
-   awk '!seen[$0]++' "$SOURCES/$CHANGELOG" "$clogf" > "$clogf.unique"
+   awk '!seen[$0]++' "$SOURCES/$SPECCHANGELOG" "$clogf" > "$clogf.unique"
# sed trick to get the end of the changelog minus the line
sed -e '1,/# END OF CHANGELOG/ d' "$clogf.unique" > "$clogf.tmp"
# Add an explicit entry to indicate a rebase.
@@ -157,8 +157,8 @@ if [ "$LENGTH" = 0 ]; then
rm -f "$clogf.rev"; touch "$clogf.rev"
 fi
 
-cat "$clogf.rev" "$SOURCES/$CHANGELOG" > "$clogf.full"
-mv -f "$clogf.full" "$SOURCES/$CHANGELOG"
+cat "$clogf.rev" "$SOURCES/$SPECCHANGELOG" > "$clogf.full"
+mv -f "$clogf.full" "$SOURCES/$SPECCHANGELOG"
 
 echo "MARKER is $MARKER"
 
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.templ

[OS-BUILD PATCH 11/16] redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename DISTRO_BUILD to SPECDISTROBUILD

Change DISTRO_BUILD to SPECDISTROBUILD so that readers understand it is passed
into the spec file.

Rename DISTRO_BUILD to SPECDISTROBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -205,10 +205,10 @@ else
 endif
 
 SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
-DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+SPECDISTROBUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(SPECDISTROBUILD).tar.bz2
 SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
 RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(SPECVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(SPECDISTROBUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -65,7 +65,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
-   s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
+   s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -87,7 +87,7 @@ Summary: The Linux kernel
 #  the --with-release option overrides this setting.)
 %define debugbuildsenabled %%DEBUG_BUILDS_ENABLED%%
 
-%global distro_build %%DISTRO_BUILD%%
+%global distro_build %%SPECDISTROBUILD%%
 
 %if 0%{?fedora}
 %define secure_boot_arch x86_64
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
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
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
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.fc25 
 DISTRO=centos 
-DISTRO_BUILD=0.rc5.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
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
@@ -12,7 +12,6 @@ CROSS_RPMFLAGS=rpmbuild --define "_sourcedir 
../redhat/rpm/SOURCES" --define "_b
 CURARCH=x86_64 
 DIST=.el7 
 DISTRO=centos 
-DISTRO_BUILD=0.rc0.78e36f3b0dae586.6 
 EARLY_YBUILD= 
 EARLY_YRELEASE= 
 FLAVOR= 
@@ -55,6 +54,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECBUILD=0.rc0.78e36f3b0dae586.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
+SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 
b/redhat/self-test/data/centos-78e36f3b0dae.fc25
index blahblah..blahblah 100644
--- 

[OS-BUILD PATCH 5/16] redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL

Change RPMKPATCHLEVEL to SPECPATCHLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKPATCHLEVEL to SPECKPATCHLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -51,7 +51,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
-RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
+SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
@@ -131,18 +131,18 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -182,7 +182,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 ifeq ($(RPMKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
-  RPMKPATCHLEVEL:=$(shell expr $(RPMKPATCHLEVEL) + 1)
+  SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
 endif
 ifndef PREBUILD_GIT_ONLY
   ifneq ($(filter $(MAKECMDGOALS),dist-git-test dist-git),)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -61,7 +61,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%SPECKVERSION%%/$SPECKVERSION/
-   s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
+   s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${SPECKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# May need to preserve word splitting in EXCLUDE_FILES
# shellcheck disable=SC2086
git diff -p --no-renames --stat "$MARKER"..  $EXCLUDE_FILES \
-   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
+   > 
${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}-redhat.patch
 else
# 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-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
+   touch "${SOURCES}/patch-${SPECKVERSION}.${SPECKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -127,14 +127,14 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kv

[OS-BUILD PATCH 6/16] redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKSUBLEVEL to SPECKSUBLEVEL

Change RPMKSUBLEVEL to SPECSUBLEVEL so that readers understand it is passed
into the spec file.

Rename RPMKSUBLEVEL to SPECKSUBLEVEL.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -52,7 +52,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
 MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
-RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
+SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
@@ -140,7 +140,7 @@ ifneq ($(RPMKEXTRAVERSION),)
   UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
-  ifeq ($(RPMKSUBLEVEL),0)
+  ifeq ($(SPECKSUBLEVEL),0)
 MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)
   else
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(SPECKPATCHLEVEL).$(SPECKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION=-rc5 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=1
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=17 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
 SPECVERSION=5.17.0 
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
@@ -51,7 +51,6 @@ RHSELFTESTDATA=1
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
 RPMKEXTRAVERSION= 
-RPMKSUBLEVEL=0 
 RPMVERSION=5.16.0-6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
@@ -59,6 +58,7 @@ SNAPSHOT=0
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
 SPECKPATCHLEVEL=16 
+SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=6%{?buildid}%{?dist} 
 SPECVERSION=5.16.0 
diff --git a/redhat/self-test/dat

[OS-BUILD PATCH 10/16] redhat/Makefile: Rename PKGRELEASE to SPECBUILD

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename PKGRELEASE to SPECBUILD

PKGRELEASE is a confusing variable name, and it really is the BUILD string
for the specfile.

Rename PKGRELEASE to SPECBUILD.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -209,8 +209,8 @@ DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
 
KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
-PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
+SPECBUILD:=$(PREBUILD)$(BUILD)$(BUILDID)
+RPMVERSION:=$(SPECVERSION)-$(SPECBUILD)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -620,9 +620,9 @@ dist-fedora-release-push: dist-fedora-release
 dist-vr-check:
@# builds may include a s390x+zfcpdump arch build.  UTS_RELEASE can 
only have a
@# version-release string with max 64 chars.  The version-release for 
s390x+zfcpdump
-   @# is 29 characters, leaving a maximum of 35 characters for PKGRELEASE.
-   @if [ $$(echo -n $(PKGRELEASE) | wc -c) -gt 35 ]; then \
-   echo "PKGRELEASE ($(PKGRELEASE)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
+   @# is 29 characters, leaving a maximum of 35 characters for SPECBUILD.
+   @if [ $$(echo -n $(SPECBUILD) | wc -c) -gt 35 ]; then \
+   echo "SPECBUILD ($(SPECBUILD)) is too long.  Use a shorter 
localversion (currently $(BUILDID))"; \
exit 1; \
fi
 
diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables
index blahblah..blahblah 100644
--- a/redhat/Makefile.variables
+++ b/redhat/Makefile.variables
@@ -100,7 +100,7 @@ BUILD ?=
 
 # Builds may include a s390x+zfcpdump arch build, which results in the build
 # failing because the UTS_RELEASE field exceeded 64 chars.  This variable can
-# be set to 1 to decrease the kernel UTS_RELEASE and PKGRELEASE by 11 
characters
+# be set to 1 to decrease the kernel UTS_RELEASE and SPECBUILD by 11 characters
 # (MMDDgit).
 PREBUILD_GIT_ONLY ?=
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2153
 
 LAST_MARKER=$(cat "${REDHAT}"/marker)
 clogf="$SOURCES/changelog"
@@ -62,7 +63,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
-   s/%%PKGRELEASE%%/$PKGRELEASE/
+   s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -131,7 +131,7 @@ Summary: The Linux kernel
 
 %define specversion %%SPECVERSION%%
 %define patchversion %%SPECKVERSION%%.%%SPECKPATCHLEVEL%%
-%define pkgrelease %%PKGRELEASE%%
+%define pkgrelease %%SPECBUILD%%
 
 # This is needed to do merge window version magic
 %define patchlevel %%SPECKPATCHLEVEL%%
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
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.el7 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECFILE=kernel.spec 
 SPECKEXTRAVERSION=-rc5 
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
@@ -33,7 +33,6 @@ MAKEFILE_LIST=Makefile Makefile.variables ../Makefile.rhelver 
Makefile.rhpkg Mak
 MAKEFLAGS=w -- HEAD=2585cf9dfaad DISTRO=centos DIST=.fc25 RHSELFTESTDATA=1 
 MARKER=v5.16-rc5 
 MERGE_BASE=2585cf9dfaaddf00b069673f27bb3f8530e2039c 
-PKGRELEASE=0.rc5.6.test 
 PREBUILD=0.rc5. 
 PROCESS_CONFIGS_CHECK_OPTS=-n -t -c 
 PROCESS_CONFIGS_OPTS=-n -w -c 
@@ -54,6 +53,7 @@ SHELL=/bin/sh
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
+SPECBUILD=0.rc5.6.test 
 SPE

[OS-BUILD PATCH 7/16] redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makfile: Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION

Change RPMKEXTRAVERSION to SPECEXTRAVERSION so that readers understand it is 
passed
into the spec file.

Rename RPMKEXTRAVERSION to SPECKEXTRAVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -53,7 +53,7 @@ MACH:=$(shell uname -m)
 SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 SPECKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 SPECKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
-RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
+SPECKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
 GITID:= $(shell $(GIT) log --max-count=1 --pretty=format:%H $(HEAD))
 ifndef BUILD
   BUILD:=$(RHEL_RELEASE)
@@ -131,13 +131,13 @@ ifeq ("$(origin O)", "command line")
 endif
 
 # MARKER is the git tag which we base off of for exporting patches
-# Make sure MARKER uses SPECKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
+# Make sure MARKER uses SPECKPATCHLEVEL and SPECKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
-ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
-  KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
+ifneq ($(SPECKEXTRAVERSION),)
+  MARKER:=v$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
+  KEXTRAVERSION:=$(shell echo $(SPECKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(SPECKPATCHLEVEL)$(SPECKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(SPECKSUBLEVEL),0)
@@ -179,7 +179,7 @@ ifeq ($(VERSION_ON_UPSTREAM),1)
 # been updated but we still need something that works for
 # packaging. Fix this by bumping the patch level and marking
 # this as rc0
-ifeq ($(RPMKEXTRAVERSION),)
+ifeq ($(SPECKEXTRAVERSION),)
   KEXTRAVERSION:=.rc0
   PREBUILD:=0$(KEXTRAVERSION).
   SPECKPATCHLEVEL:=$(shell expr $(SPECKPATCHLEVEL) + 1)
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION=-rc5 
 RPMVERSION=5.16.0-0.rc5.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=0 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHSELFTESTDATA=1 
 RPM=../redhat/rpm 
 RPMBUILD=rpmbuild 
-RPMKEXTRAVERSION= 
 RPMVERSION=5.17.0-0.rc0.78e36f3b0dae586.6.test 
 SHELL=/bin/sh 
 SINGLE_TARBALL=1 
 SNAPSHOT=1 
 SOURCES=../redhat/rpm/SOURCES 
 SPECFILE=kernel.spec 
+SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
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
@@ -50,13 +50,13 @@ RHPKG_BIN=centpkg
 RHS

[OS-BUILD PATCH 4/16] redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename RPMKVERSION to SPECKVERSION

Change RPMKVERSION to SPECVERSION so that readers understand it is passed
into the spec file.

Rename RPMKVERSION to SPECKVERSION.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -50,7 +50,7 @@ RPMBUILD:=$(shell if [ -x "/usr/bin/rpmbuild" ]; then echo 
rpmbuild; \
   else echo rpm; fi)
 
 MACH:=$(shell uname -m)
-RPMKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
+SPECKVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^VERSION\ =\ 
/{s///;p;q}')
 RPMKPATCHLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^PATCHLEVEL\ 
=\ /{s///;p;q}')
 RPMKSUBLEVEL:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne '/^SUBLEVEL\ =\ 
/{s///;p;q}')
 RPMKEXTRAVERSION:=$(shell $(GIT) show $(HEAD):Makefile | sed -ne 
'/^EXTRAVERSION\ =\ /{s///;p;q}')
@@ -134,15 +134,15 @@ endif
 # Make sure MARKER uses RPMKPATCHLEVEL and RPMKEXTRAVERSION from the kernel
 # makefile as opposed to any adjusted version for snapshotting.
 ifneq ($(RPMKEXTRAVERSION),)
-  MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
   KEXTRAVERSION:=$(shell echo $(RPMKEXTRAVERSION) | sed -e s/-/./)
   PREBUILD:=0$(KEXTRAVERSION).
-  UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
+  UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)$(RPMKEXTRAVERSION)
 else
   KEXTRAVERSION:=
   ifeq ($(RPMKSUBLEVEL),0)
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
+MARKER:=v$(SPECKVERSION).$(RPMKPATCHLEVEL)
+UPSTREAM_TARBALL_NAME:=$(SPECKVERSION).$(RPMKPATCHLEVEL)
   else
 MARKER:=v$(SPECVERSION)
 UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
@@ -204,7 +204,7 @@ else
   SNAPSHOT:=0
 endif
 
-SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(SPECKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -60,7 +60,7 @@ test -f "$SOURCES/$SPECFILE" &&
/%%CHANGELOG%%/r $SOURCES/$CHANGELOG
/%%CHANGELOG%%/d
s/%%BUILDID%%/$BUILDID_DEFINE/
-   s/%%RPMKVERSION%%/$RPMKVERSION/
+   s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
@@ -89,7 +89,7 @@ done
 
 echo > "$clogf"
 
-lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${RPMKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
+lasttag=$(git rev-list --first-parent --grep="^\[redhat\] 
kernel-${SPECKVERSION}.${RPMKPATCHLEVEL}" --max-count=1 HEAD)
 # if we didn't find the proper tag, assume this is the first release
 if [[ -z $lasttag ]]; then
 if [[ -z ${MARKER//[0-9a-f]/} ]]; then
@@ -168,12 +168,12 @@ if [ "$SINGLE_TARBALL" = 0 ]; then
# 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
+   > 
${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}-redhat.patch
 else
# 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
+   touch "${SOURCES}/patch-${SPECKVERSION}.${RPMKPATCHLEVEL}"-redhat.patch
 fi
 
 rm -f "$clogf"{,.rev,.stripped};
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -127,10 +127,10 @@ Summary: The Linux kernel
 %endif
 
 # The kernel tarball/base version
-%define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define kversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 
 %define specversion %%SPECVERSION%%
-%define patchversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
+%define patchversion %%SPECKVERSION%%.%%RPMKPATCHLEVEL%%
 %define pkgrelease %%PKGRELEASE%%
 
 # This is needed to do merge window version magic
@@ -1357,7 +1357,7 @@ ApplyPatch()
 exit 1
   fi
   if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; 
then
-if [ "${patch:0:8}" != "patch-%%RPMKVERSION%%." ] ; then
+if [ "${patch:0:8}" != "patch-%%SPECKVERSION%%." ] ; then
   echo "ERROR: Patch  $patch  not listed as a source patch in specfile"
   exit 1

[OS-BUILD PATCH 0/16] redhat: Use SPEC variable naming

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727

Depends: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1647

One of the common complaints about the redhat Makefiles, genspec.sh, and
kernel.spec.template is that it is not possible to determine which
variables are being used in the Makefiles and which are being used in the
kernel.spec.template.

This changeset introduces a convention of prefixing all variables used in
the kernel.spec.template with SPEC so that knowledgeable readers can track
variable use and see how variable changes affect the kernel spec file.

Signed-off-by: Prarit Bhargava 

---
 redhat/configs/generate_all_configs.sh  |2 +-
 redhat/docs/makefile-changes.rst|8 +-
 redhat/scripts/create-tarball.sh|2 +-
 redhat/self-test/data/centos-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/centos-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/centos-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/centos-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/centos-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/centos-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/centos-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/centos-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/centos-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.el7   |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-2585cf9dfaad.fc25  |   21 ++-
 redhat/self-test/data/fedora-2585cf9dfaad.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.el7   |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-78e36f3b0dae.fc25  |   21 ++-
 redhat/self-test/data/fedora-78e36f3b0dae.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.el7   |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-df0cc57e057f.fc25  |   21 ++-
 redhat/self-test/data/fedora-df0cc57e057f.fc25.spec |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.el7   |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.el7.spec  |   24 ++--
 redhat/self-test/data/fedora-fce15c45d3fb.fc25  |   21 ++-
 redhat/self-test/data/fedora-fce15c45d3fb.fc25.spec |   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.el7 |   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.el7.spec|   24 ++--
 redhat/self-test/data/rhel-2585cf9dfaad.fc25|   21 ++-
 redhat/self-test/data/rhel-2585cf9dfaad.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.el7 |   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.el7.spec|   24 ++--
 redhat/self-test/data/rhel-78e36f3b0dae.fc25|   21 ++-
 redhat/self-test/data/rhel-78e36f3b0dae.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.el7 |   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.el7.spec|   24 ++--
 redhat/self-test/data/rhel-df0cc57e057f.fc25|   21 ++-
 redhat/self-test/data/rhel-df0cc57e057f.fc25.spec   |   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.el7 |   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.el7.spec|   24 ++--
 redhat/self-test/data/rhel-fce15c45d3fb.fc25|   21 ++-
 redhat/self-test/data/rhel-fce15c45d3fb.fc25.spec   |   24 ++--
 redhat/self-test/1006-verify-SPEC-variables.bats|   24 
 redhat/Makefile |  102 +++
 redhat/Makefile.variables   |2 +-
 redhat/genspec.sh   |   55 +-
 redhat/kernel.spec.template |   56 +-
 56 files changed, 725 insertions(+), 606 deletions(-)
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 9/16] redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename BUILDID_DEFINE to SPECBUILDID

Change BUILDID_DEFINE to SPECBUILDID so that readers understand it is passed
into the spec file.

Rename BUILDID_DEFINE to SPECBUILDID.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -23,9 +23,9 @@ else
 fi
 
 if [ -n "$BUILDID" ]; then
-   BUILDID_DEFINE=$(printf "%%define buildid %s" "$BUILDID")
+   SPECBUILDID=$(printf "%%define buildid %s" "$BUILDID")
 else
-   BUILDID_DEFINE="# define buildid .local"
+   SPECBUILDID="# define buildid .local"
 fi
 
 EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
@@ -59,7 +59,7 @@ test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
/%%SPECCHANGELOG%%/d
-   s/%%BUILDID%%/$BUILDID_DEFINE/
+   s/%%SPECBUILDID%%/$SPECBUILDID/
s/%%SPECKVERSION%%/$SPECKVERSION/
s/%%SPECKPATCHLEVEL%%/$SPECKPATCHLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -117,7 +117,7 @@ Summary: The Linux kernel
 # for parallel xz processes, replace with 1 to go back to single process
 %endif
 
-%%BUILDID%%
+%%SPECBUILDID%%
 
 
 %if 0%{?fedora}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 3/16] redhat/Makefile: Rename KVERSION to SPECVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename KVERSION to SPECVERSION

KVERSION is passed into the spec file and is easy to confuse with the
kernel KVERSION.  Change the name to SPECVERSION so that readers
understand it is the %Version field of the specfile.

As a result RPMKSUBLEVEL can be dropped from genspec.sh.

Rename KVERSION to SPECVERSION and use it in the specfile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(KVERSION)
-UPSTREAM_TARBALL_NAME:=$(KVERSION)
+MARKER:=v$(SPECVERSION)
+UPSTREAM_TARBALL_NAME:=$(SPECVERSION)
   endif
   PREBUILD:=
 endif
@@ -204,13 +204,13 @@ else
   SNAPSHOT:=0
 endif
 
-KVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+SPECVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
 DISTRO_BUILD:=$(PREBUILD)$(shell echo $(BUILD) | sed -e 
's|\(^[0-9]\{1,4\}\)\..*|\1|')
-KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 KABIDW := $(REDHAT)/kabi-dwarf
-KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
+KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
+RPMVERSION:=$(SPECVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 
@@ -352,11 +352,11 @@ dist-kabi-dw-check: dist-kabi
 
 dist-configs-commit: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh -z "$(KVERSION)" "$(FLAVOR)"
+   ./process_configs.sh -z "$(SPECVERSION)" "$(FLAVOR)"
 
 dist-configs: dist-configs-prep
+@cd $(REDHAT)/configs; ./generate_all_configs.sh 1;\
-   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(KVERSION)" ""
+   ./process_configs.sh $(PROCESS_CONFIGS_OPTS) "$(SPECVERSION)" ""
 
 dist-fedora-configs: FLAVOR = fedora
 dist-fedora-configs: dist-configs
@@ -425,12 +425,12 @@ dist-tarball: $(TARBALL)
 dist-kernelrelease:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
+   @echo $(PACKAGE_NAME)-$(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
# deprecated at 5.17.0
@echo "WARNING: This target will be deprecated in a future release."
-   @echo $(KVERSION)-$(DISTRO_BUILD)
+   @echo $(SPECVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
# deprecated at 5.17.0
diff --git a/redhat/configs/generate_all_configs.sh 
b/redhat/configs/generate_all_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/generate_all_configs.sh
+++ b/redhat/configs/generate_all_configs.sh
@@ -18,7 +18,7 @@ else
 fi
 
 for i in kernel-*-"$FLAVOR".config; do
-   NEW=kernel-"$KVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
+   NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed 
s/-"$FLAVOR"//)
#echo $NEW
mv "$i" "$NEW"
 done
diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -73,4 +73,4 @@ or,
   dist-kernelversion:
 # deprecated in 5.17.0
 @echo "WARNING: This target will be removed in a later release."
-@echo $(KVERSION)-$(DISTRO_BUILD)
+@echo $(SPECVERSION)-$(DISTRO_BUILD)
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -62,7 +62,6 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%BUILDID%%/$BUILDID_DEFINE/
s/%%RPMKVERSION%%/$RPMKVERSION/
s/%%RPMKPATCHLEVEL%%/$RPMKPATCHLEVEL/
-   s/%%RPMKSUBLEVEL%%/$RPMKSUBLEVEL/
s/%%PKGRELEASE%%/$PKGRELEASE/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%DISTRO_BUILD%%/$DISTRO_BUILD/
@@ -71,6 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -129,7 +129,7 @@ Summary: The Linux kernel
 # The kernel tarball/base version
 %define kversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%
 
-%define rpmversion %%RPMKVERSION%%.%%RPMKPATCHLEVEL%%.%%

[OS-BUILD PATCH 13/16] redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/genspec: Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG

Change PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG so that readers
understand it is passed into the spec file.

Rename PATCHLIST_CHANGELOG to SPECPATCHLIST_CHANGELOG.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -40,7 +40,7 @@ EXCLUDE_FILES=":(exclude,top).get_maintainer.conf \
 
 # If PATCHLIST_URL is not set to "none", generate Patchlist.changelog file that
 # holds the shas and commits not included upstream and git commit url.
-PATCHLIST_CHANGELOG=0
+SPECPATCHLIST_CHANGELOG=0
 if [ "$PATCHLIST_URL" != "none" ]; then
# sed convert
#  
@@ -53,7 +53,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. 
$EXCLUDE_FILES | \
sed "s!^\([^ ]*\)!$PATCHLIST_URL/\1\n &!; s!\$!\n!" \
> "$SOURCES"/Patchlist.changelog
-   PATCHLIST_CHANGELOG=1
+   SPECPATCHLIST_CHANGELOG=1
 fi
 
 test -f "$SOURCES/$SPECFILE" &&
@@ -70,7 +70,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
-   s/%%PATCHLIST_CHANGELOG%%/$PATCHLIST_CHANGELOG/
+   s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -8,7 +8,7 @@
 # Include RHEL files
 %global include_rhel %%INCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
-%global patchlist_changelog %%PATCHLIST_CHANGELOG%%
+%global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
 # Disable LTO in userspace packages.
 %global _lto_cflags %{nil}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 16/16] redhat/self-test: Add test to verify SPEC variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/self-test: Add test to verify SPEC variables

This test looks at the spec file variable replacement code in
redhat/genspec.sh and confirms that each variable begins with "SPEC".

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/docs/makefile-changes.rst b/redhat/docs/makefile-changes.rst
index blahblah..blahblah 100644
--- a/redhat/docs/makefile-changes.rst
+++ b/redhat/docs/makefile-changes.rst
@@ -46,6 +46,12 @@ external scripts.  Variables in this file should be 
considered stable.
 Variables still may be deprecated and will follow the guidelines in
 "Deprecating variables and targets" section below.
 
+Variable Naming
+===
+
+Variables names prefixed with SPEC indicate that the variable is used
+in redhat/kernel.spec.template (see redhat/genspec.sh).
+
 Deprecating variables and targets
 =
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -56,6 +56,7 @@ if [ "$PATCHLIST_URL" != "none" ]; then
SPECPATCHLIST_CHANGELOG=1
 fi
 
+# self-test begin
 test -f "$SOURCES/$SPECFILE" &&
sed -i -e "
/%%SPECCHANGELOG%%/r $SOURCES/$SPECCHANGELOG
@@ -73,6 +74,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+# self-test end
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
diff --git a/redhat/self-test/1006-verify-SPEC-variables.bats 
b/redhat/self-test/1006-verify-SPEC-variables.bats
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/self-test/1006-verify-SPEC-variables.bats
@@ -0,0 +1,24 @@
+#!/usr/bin/env bats
+
+@test "verify SPEC variables" {
+# This test looks at the spec file variable replacement code in
+# redhat/genspec.sh and confirms that each variable begins with "SPEC".
+
+# This looks at the code and replaces each / with a new-line character, removes
+# any whitespace and entry entries beginning with valid "%%SPEC" or $"SPEC".
+# "$SOURCES" lines are also okay as it is used to point to the changelog and
+# the specfile.
+awk '/# self-test begin/, /# self-test end/' $BATS_TEST_DIRNAME/../genspec.sh 
| grep -v "^#" | tr "/" "\n" | tr -d "\"" | sed -r '/^\s*$/d' | grep -v 
"%%SPEC" | grep -v "\$SPEC" | grep -v "\$SOURCES" | while read LINE
+do
+   case $(echo $LINE | xargs) in
+   s) ;;
+   d) ;;
+#"sed -i -e") ;;
+   *)
+   echo " "
+   echo "ERROR: Variables passed between genspec.sh and the spec 
file must begin with %%SPEC or \$SPEC."
+   exit 1
+   ;;
+   esac
+done
+}

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 2/18] redhat/Makefile: Deprecate some simple targets

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate some simple targets

Deprecate some simple targets.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -418,15 +418,23 @@ $(KABIDW_TARBALL):
 
 
 dist-tarball: $(TARBALL)
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo "redhat/$(TARFILE)"
 
 dist-kernelrelease:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(KVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(SOURCES)/$(SPECFILE)
 
 dist-git-version-check:

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 2/16] redhat/Makefile: Deprecate some simple targets

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Deprecate some simple targets

Deprecate some simple targets.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -418,15 +418,23 @@ $(KABIDW_TARBALL):
 
 
 dist-tarball: $(TARBALL)
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo "redhat/$(TARFILE)"
 
 dist-kernelrelease:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(PACKAGE_NAME)-$(KVERSION)-$(DISTRO_BUILD)
 
 dist-kernelversion:
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(KVERSION)-$(DISTRO_BUILD)
 
 dist-specfile: setup-source
+   # deprecated at 5.17.0
+   @echo "WARNING: This target will be deprecated in a future release."
@echo $(SOURCES)/$(SPECFILE)
 
 dist-git-version-check:

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 14/16] redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Rename TARFILE_RELEASE to SPECTARFILE_RELEASE

Change TARFILE_RELEASE to SPECTARFILE_RELEASE so that readers
understand it is passed into the spec file.

Rename TARFILE_RELEASE to SPECTARFILE_RELEASE.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -220,7 +220,7 @@ SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 #
 ifeq ("$(DISTRO)", "fedora")
   SINGLE_TARBALL:=0
-  TARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
+  SPECTARFILE_RELEASE:=$(UPSTREAM_TARBALL_NAME)
   RHDISTGIT_BRANCH:=rawhide
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=temp-ark-rhel-8-test
@@ -234,21 +234,21 @@ else ifeq ("$(DISTRO)", "centos")
   ifndef BUILD_SCRATCH_TARGET
 BUILD_SCRATCH_TARGET:=c$(RHEL_MAJOR)s-candidate
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 else
   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
   endif
-  TARFILE_RELEASE:=$(RPMVERSION)
+  SPECTARFILE_RELEASE:=$(RPMVERSION)
 endif
 
 ifndef BUILD_TARGET
   BUILD_TARGET:=--scratch $(BUILD_SCRATCH_TARGET)
 endif
 
-TARFILE:=linux-$(TARFILE_RELEASE).tar.xz
+TARFILE:=linux-$(SPECTARFILE_RELEASE).tar.xz
 TARBALL:=$(REDHAT)/$(TARFILE)
 
 include Makefile.rhpkg
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -72,7 +72,7 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
-   s/%%TARFILE_RELEASE%%/$TARFILE_RELEASE/" "$SOURCES/$SPECFILE"
+   s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
 
 # We depend on work splitting of BUILDOPTS
 # shellcheck disable=SC2086
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -692,7 +692,7 @@ BuildRequires: lld
 # exact git commit you can run
 #
 # xzcat -qq ${TARBALL} | git get-tar-commit-id
-Source0: linux-%%TARFILE_RELEASE%%.tar.xz
+Source0: linux-%%SPECTARFILE_RELEASE%%.tar.xz
 
 Source1: Makefile.rhelver
 
@@ -1384,8 +1384,8 @@ ApplyOptionalPatch()
   fi
 }
 
-%setup -q -n kernel-%%TARFILE_RELEASE%% -c
-mv linux-%%TARFILE_RELEASE%% linux-%{KVERREL}
+%setup -q -n kernel-%%SPECTARFILE_RELEASE%% -c
+mv linux-%%SPECTARFILE_RELEASE%% linux-%{KVERREL}
 
 cd linux-%{KVERREL}
 cp -a %{SOURCE1} .
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
@@ -27,4 +27,4 @@ trap 'rm -vf "$TARBALL"' INT
 # XZ_OPTIONS and XZ_THREADS DEPEND on word splitting, so don't disable it here:
 # shellcheck disable=SC2086
 cd ../ &&
-  git archive --prefix="linux-$TARFILE_RELEASE"/ --format=tar "$_GITID" | xz 
$XZ_OPTIONS $XZ_THREADS > "$TARBALL";
+  git archive --prefix="linux-$SPECTARFILE_RELEASE"/ --format=tar "$_GITID" | 
xz $XZ_OPTIONS $XZ_THREADS > "$TARBALL";
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
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
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
@@ -61,12 +61,12 @@ SPECKPATCHLEVEL=16
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
 SRPMS=../redhat/rpm/SRPMS 
 TARBALL=../redhat/linux-5.16.0-0.rc5.6.test.tar.xz 
 TARFILE=linux-5.16.0-0.rc5.6.test.tar.xz 
-TARFILE_RELEASE=5.16.0-0.rc5.6.test 
 TESTPATCH=../redhat/linux-kernel-test.patch 
 TOPDIR=.. 
 UPSTREAM_TARBALL_NAME=5.16-rc5 
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

[OS-BUILD PATCH 1/16] redhat/Makefile: Use KVERSION

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Use KVERSION

Use KVERSION where appropriate in the Makefile.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -144,8 +144,8 @@ else
 MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL)
 UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL)
   else
-MARKER:=v$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
-UPSTREAM_TARBALL_NAME:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)
+MARKER:=v$(KVERSION)
+UPSTREAM_TARBALL_NAME:=$(KVERSION)
   endif
   PREBUILD:=
 endif
@@ -210,7 +210,7 @@ 
KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(KVERSION)-$(DISTRO_BUILD).tar.
 KABIDW := $(REDHAT)/kabi-dwarf
 KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(KVERSION)-$(DISTRO_BUILD).tar.bz2
 PKGRELEASE:=$(PREBUILD)$(BUILD)$(BUILDID)
-RPMVERSION:=$(RPMKVERSION).$(RPMKPATCHLEVEL).$(RPMKSUBLEVEL)-$(PKGRELEASE)
+RPMVERSION:=$(KVERSION)-$(PKGRELEASE)
 SPECRELEASE:=$(PREBUILD)$(BUILD)%{?buildid}%{?dist}
 SRPM:=$(SRPMS)/$(PACKAGE_NAME)-$(RPMVERSION)$(DIST).src.rpm
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1727
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[OS-BUILD PATCH 15/16] redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

2022-04-22 Thread Prarit Bhargava (via Email Bridge)
From: Prarit Bhargava 

redhat/Makefile: Add 'duplicate' SPEC entries for user set variables

INCLUDE_FEDORA_FILES, INCLUDE_RHEL_FILES, and RELEASED_KERNEL are
specified in Makefile.variables as they can be set in userspace.

Create duplicate entries for these variables that begin with SPEC.  This
will make debugging easier and indicate that the variables are passed into
the spec file.

Signed-off-by: Prarit Bhargava 

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -26,6 +26,12 @@ ifdef SINGLE_TARBALL
 endif
 
 include Makefile.variables
+# These entries are 'duplicates' of variables specified in Makefile.variables
+# that are used in the SPEC file.  Specifying these with a SPEC prefix 
indicates
+# that the value is passed through to the spec file.
+SPECRELEASED_KERNEL=$(RELEASED_KERNEL)
+SPECINCLUDE_FEDORA_FILES=$(INCLUDE_FEDORA_FILES)
+SPECINCLUDE_RHEL_FILES=$(INCLUDE_RHEL_FILES)
 
 LANG=C
 
diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index blahblah..blahblah 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -66,10 +66,10 @@ test -f "$SOURCES/$SPECFILE" &&
s/%%SPECBUILD%%/$SPECBUILD/
s/%%SPECRELEASE%%/$SPECRELEASE/
s/%%SPECDISTROBUILD%%/$SPECDISTROBUILD/
-   s/%%RELEASED_KERNEL%%/$RELEASED_KERNEL/
+   s/%%SPECRELEASED_KERNEL%%/$SPECRELEASED_KERNEL/
s/%%SPECDEBUG_BUILDS_ENABLED%%/$SPECDEBUG_BUILDS_ENABLED/
-   s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/
-   s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/
+   s/%%SPECINCLUDE_FEDORA_FILES%%/$SPECINCLUDE_FEDORA_FILES/
+   s/%%SPECINCLUDE_RHEL_FILES%%/$SPECINCLUDE_RHEL_FILES/
s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/
s/%%SPECVERSION%%/$SPECVERSION/
s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/" "$SOURCES/$SPECFILE"
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -4,9 +4,9 @@
 # here before the %%install macro is pre-built.
 
 # Include Fedora files
-%global include_fedora %%INCLUDE_FEDORA_FILES%%
+%global include_fedora %%SPECINCLUDE_FEDORA_FILES%%
 # Include RHEL files
-%global include_rhel %%INCLUDE_RHEL_FILES%%
+%global include_rhel %%SPECINCLUDE_RHEL_FILES%%
 # Provide Patchlist.changelog file
 %global patchlist_changelog %%SPECPATCHLIST_CHANGELOG%%
 
@@ -77,7 +77,7 @@ Summary: The Linux kernel
 #  kernel release. (This includes prepatch or "rc" releases.)
 # Set released_kernel to 0 when the upstream source tarball contains an
 #  unreleased kernel development snapshot.
-%global released_kernel %%RELEASED_KERNEL%%
+%global released_kernel %%SPECRELEASED_KERNEL%%
 
 # Set debugbuildsenabled to 1 to build separate base and debug kernels
 #  (on supported architectures). The kernel-debug-* subpackages will
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
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.el7.src.rpm 
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
@@ -56,11 +56,14 @@ SPECBUILD=0.rc5.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc5.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION=-rc5 
 SPECKPATCHLEVEL=16 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc5.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.16.0-0.rc5.6.test 
 SPECVERSION=5.16.0 
 SRPM=../redhat/rpm/SRPMS/kernel-5.16.0-0.rc5.6.test.fc25.src.rpm 
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
@@ -56,11 +56,14 @@ SPECBUILD=0.rc0.78e36f3b0dae586.6.test
 SPECCHANGELOG=kernel.changelog-9.99 
 SPECDISTROBUILD=0.rc0.78e36f3b0dae586.6 
 SPECFILE=kernel.spec 
+SPECINCLUDE_FEDORA_FILES=1 
+SPECINCLUDE_RHEL_FILES=1 
 SPECKEXTRAVERSION= 
 SPECKPATCHLEVEL=17 
 SPECKSUBLEVEL=0 
 SPECKVERSION=5 
 SPECRELEASE=0.rc0.78e36f3b0dae586.6%{?buildid}%{?dist} 
+SPECRELEASED_KERNEL=0 
 SPECTARFILE_RELEASE=5.17.0-0.rc0.78e36f3

[OS-BUILD PATCH] redhat/configs: aarch64: enable CPU_FREQ_GOV_SCHEDUTIL

2022-04-22 Thread Mark Salter (via Email Bridge)
From: Mark Salter 

redhat/configs: aarch64: enable CPU_FREQ_GOV_SCHEDUTIL

RHEL8 has CPU_FREQ_GOV_SCHEDUTIL=y as default and individual arches
needed to disable it if desired. Ark/Centos-Stream/RHEL9 has the
default =n and individual arches must enable. Aarch64 was missed in
this transition, so let's enable it now.

Signed-off-by: Mark Salter 

diff --git 
a/redhat/configs/ark/generic/arm/aarch64/CONFIG_CPU_FREQ_GOV_SCHEDUTIL 
b/redhat/configs/ark/generic/arm/aarch64/CONFIG_CPU_FREQ_GOV_SCHEDUTIL
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/configs/ark/generic/arm/aarch64/CONFIG_CPU_FREQ_GOV_SCHEDUTIL
@@ -0,0 +1 @@
+CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1762
___
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
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@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure