From 3391b85e233fb582fff9471c23788df5ad582d21 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 15 Feb 2024 08:58:03 -0500 Subject: [PATCH] Temporarily add Node.js 20 as default for F41 and RHEL 11+ Signed-off-by: Stephen Gallagher --- nodejs-sources.sh | 15 +++++++++++---- nodejs20.spec | 2 +- packaging/nodejs.spec.j2 | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/nodejs-sources.sh b/nodejs-sources.sh index 3b246e4..32d7302 100755 --- a/nodejs-sources.sh +++ b/nodejs-sources.sh @@ -148,8 +148,14 @@ fi FEDORA_DEFAULT_RELEASE_LOW=$((NODE_PKG_MAJOR + 19)) FEDORA_DEFAULT_RELEASE_HIGH=$((NODE_PKG_MAJOR + 20)) -if [[ $((NODE_PKG_MAJOR)) -eq 20 ]] - then RHEL_DEFAULT_RELEASE=" || 0%{?rhel} == 10" +if [[ $((NODE_PKG_MAJOR)) -eq 20 ]]; then + RHEL_DEFAULT_RELEASE=" || 0%{?rhel} == 10" +fi + +# Handle the situation where the next stable release of Node.js isn't yet +# available to include. +if [[ $((NODE_PKG_MAJOR)) -eq 20 ]]; then + TEMPORARY_RELEASE=" || 0%{?fedora} == 41 || 0%{?rhel} >= 11" fi rm -rf node-v${version}.tar.gz \ @@ -307,7 +313,8 @@ IFS='' read -r -d '' template_json <= 11 %global nodejs_default %{nodejs_pkg_major} %endif diff --git a/packaging/nodejs.spec.j2 b/packaging/nodejs.spec.j2 index 2bfe6dc..af28bf4 100644 --- a/packaging/nodejs.spec.j2 +++ b/packaging/nodejs.spec.j2 @@ -44,7 +44,7 @@ # Determine if this should be the default version for this Fedora release # The default version will own /usr/bin/node and friends -%if 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_LOW }} || 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_HIGH }}{{ RHEL_DEFAULT_RELEASE }} +%if 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_LOW }} || 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_HIGH }}{{ RHEL_DEFAULT_RELEASE }}{{ TEMPORARY_RELEASE }} %global nodejs_default %{nodejs_pkg_major} %endif