Skip to content

Commit 8412a3c

Browse files
committed
redhat: introduce RELEASE_LOCALVERSION variable
JIRA: INTERNAL Upstream Stauts: RHEL only (ARK commit 10c3f06ddf0eb38e9b72e7dc271e4b180db6a34d) commit 10c3f06ddf0eb38e9b72e7dc271e4b180db6a34d Author: Jan Stancek <jstancek@redhat.com> Date: Tue Oct 21 07:50:37 2025 +0200 redhat: introduce RELEASE_LOCALVERSION variable Sometimes we run into situation where people forget to set proper localversion during official builds and end up with .test in NVR. Introduce a new variable to Makefile.variables, which will be persisted in source-git as well (contrast to localversion) and take priority when used for dist-rtg targets. The scenarios where we need custom localversion for official build should be very rare, meaning that the maintainer doesn't need to touch this variable and default (empty localversion) will be used instead of whatever may be left in 'localversion' (or DISTLOCALVERSION). Signed-off-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Jan Stancek <jstancek@redhat.com>
1 parent ec5f4d3 commit 8412a3c

26 files changed

+36
-0
lines changed

redhat/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ ifndef RHJOBS
9393
fi)
9494
endif
9595

96+
# for official builds use RELEASE_LOCALVERSION persisted in Makefile.variables
97+
ifneq ($(filter $(MAKECMDGOALS),dist-release dist-release-tag dist-release-git dist-rtg),)
98+
DISTLOCALVERSION:=$(RELEASE_LOCALVERSION)
99+
ifeq (,$(findstring s,$(firstword -$(MAKEFLAGS))))
100+
$(info DISTLOCALVERSION is "$(DISTLOCALVERSION)".)
101+
endif
102+
else
96103
LOCVERFILE:=../localversion
97104
# create an empty localversion file if you don't want a local buildid
98105
ifneq ($(wildcard $(LOCVERFILE)),)
@@ -110,6 +117,7 @@ else
110117
endif
111118
$(info DISTLOCALVERSION is "$(DISTLOCALVERSION)".)
112119
endif
120+
endif # MAKECMDGOALS
113121

114122
# options for process_configs.sh script
115123
ifdef NO_CONFIGCHECKS

redhat/Makefile.variables

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ NO_CONFIGCHECKS ?=
114114
# considered stable and may be changed or removed without warning.
115115
RHSELFTESTDATA ?=
116116

117+
# Local version to be used for official (non-scratch) builds. Makefile
118+
# dist-{release/tag/git} targets will ignore localversion and DISTLOCALVERSION
119+
RELEASE_LOCALVERSION:=
120+
117121
# This variable is used by the redhat/self-tests. It should not be
118122
# considered stable and my be changed or removed without warning.
119123
RHDISTDATADIR ?=

redhat/self-test/data/centos-6161a435c191.el7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-0.rc4.6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-6161a435c191.fc25

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-0.rc4.6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-9f4ad9e425a1.el7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-9f4ad9e425a1.fc25

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-a5e13c6df0e4.el7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-0.rc5.6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-a5e13c6df0e4.fc25

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-0.rc5.6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-edc9dd1e3c31.el7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

redhat/self-test/data/centos-edc9dd1e3c31.fc25

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PROCESS_CONFIGS_CHECK_OPTS=-n -t -c
4545
PROCESS_CONFIGS_OPTS=-n -w -c
4646
REDHAT=../redhat
4747
RELEASETAG=kernel-5.12.0-6.test
48+
RELEASE_LOCALVERSION=
4849
RHDISTGIT_BRANCH=c9s
4950
RHDISTGIT_USER="shadowman"
5051
RHEL_MAJOR=9

0 commit comments

Comments
 (0)