Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/rpm/script_generator/base_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
Comment on lines +35 to +38
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add the /os-release fallback in the template guard.

This still only checks /etc/system-release, so TencentOS/OpenCloudOS hosts that expose the distro marker only via /os-release will keep tripping the unsupported-system path. Since scripts/rpm/script_generator/generator.sh:4-18 emits the versioned setup_*.x files from this template, the fix needs to land here and then be regenerated across the generated scripts.

Suggested patch
-if ! [ -f /etc/redhat-release ] \
-  && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
-  && ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
-  && ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
+if ! [ -f /etc/redhat-release ] \
+  && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
+  && ! grep -Eqi "TencentOS|OpenCloudOS" /etc/system-release /os-release 2>/dev/null; then
     handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -Eqi "TencentOS|OpenCloudOS" /etc/system-release /os-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/rpm/script_generator/base_script.sh` around lines 35 - 38, The
conditional guard beginning with "if ! [ -f /etc/redhat-release ] && ! grep -q
\"Amazon Linux\" /etc/system-release ..." misses fallbacks that check
/etc/os-release for TencentOS/OpenCloudOS; update that if-condition to also grep
/etc/os-release (e.g., add "&& ! grep -qi \"TencentOS\" /etc/os-release
2>/dev/null && ! grep -qi \"OpenCloudOS\" /etc/os-release 2>/dev/null") so the
template recognizes those distros when only /etc/os-release is present, then
regenerate the derived setup_*.x files from the generator so the change
propagates.

Copy link
Copy Markdown
Author

@shouhuanxiaoji shouhuanxiaoji Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the original code only checks /etc/system-release for Amazon Linux, it does not add the callback's /etc/os-release check.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shouhuanxiaoji, that's a fair point. Since TencentOS does have /etc/system-release (as noted in the PR description), the existing grep check against that file will work correctly — no /os-release fallback is needed. The consistency with how Amazon Linux is handled (only checking /etc/system-release) also makes the pattern uniform.

I'll withdraw the suggestion.


✏️ Learnings added
Learnt from: shouhuanxiaoji
Repo: nodesource/distributions PR: 1926
File: scripts/rpm/script_generator/base_script.sh:35-38
Timestamp: 2026-03-09T13:32:24.267Z
Learning: In the nodesource/distributions repository, TencentOS has /etc/system-release (and /os-release at root, but NOT /etc/os-release). The RPM-based detection scripts (scripts/rpm/script_generator/base_script.sh and generated setup_*.x files) only check /etc/system-release for OS identification (consistent with Amazon Linux detection), which is sufficient for TencentOS and OpenCloudOS since both provide /etc/system-release.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
15 changes: 9 additions & 6 deletions scripts/rpm/setup_16.x
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ print_bold \
Use the installation script that corresponds to the version of Node.js you
wish to install. e.g.

* ${red}https://rpm.nodesource.com/setup_16.x Node.js 16 \"Gallium\" ${bold}(deprecated)${normal}
* ${green}https://rpm.nodesource.com/setup_18.x Node.js 18 \"Hydrogen\" (Maintenance)${normal}
* ${red}https://rpm.nodesource.com/setup_19.x Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal}
* ${bold}${green}https://rpm.nodesource.com/setup_20.x Node.js 20 LTS \"Iron\" (recommended)${normal}
* ${green}https://rpm.nodesource.com/setup_21.x Node.js 21 \"Iron\" (current)${normal}
* ${red}https://rpm.nodesource.com/setup_16.x - Node.js 16 \"Gallium\" ${bold}(deprecated)${normal}
* ${green}https://rpm.nodesource.com/setup_18.x - Node.js 18 \"Hydrogen\" (Maintenance)${normal}
* ${red}https://rpm.nodesource.com/setup_19.x - Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal}
* ${bold}${green}https://rpm.nodesource.com/setup_20.x - Node.js 20 LTS \"Iron\" (recommended)${normal}
* ${green}https://rpm.nodesource.com/setup_21.x - Node.js 21 \"Iron\" (current)${normal}
Comment on lines +69 to +73
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Refresh the deprecation warning's release matrix.

These labels are stale now: 18.x and 21.x are already end-of-life, 20.x and 22.x are Maintenance LTS, 24.x is Active LTS, and 25.x is Current as of March 9, 2026. The current banner can steer users toward unsupported or non-current installers. (github.com)

Suggested patch
-  * ${green}https://rpm.nodesource.com/setup_18.x - Node.js 18 \"Hydrogen\" (Maintenance)${normal}
+  * ${red}https://rpm.nodesource.com/setup_18.x - Node.js 18 \"Hydrogen\" ${bold}(deprecated)${normal}
   * ${red}https://rpm.nodesource.com/setup_19.x - Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal}
-  * ${bold}${green}https://rpm.nodesource.com/setup_20.x - Node.js 20 LTS \"Iron\" (recommended)${normal}
-  * ${green}https://rpm.nodesource.com/setup_21.x - Node.js 21 \"Iron\" (current)${normal}
+  * ${green}https://rpm.nodesource.com/setup_20.x - Node.js 20 LTS \"Iron\" (Maintenance)${normal}
+  * ${green}https://rpm.nodesource.com/setup_22.x - Node.js 22 LTS \"Jod\" (Maintenance)${normal}
+  * ${bold}${green}https://rpm.nodesource.com/setup_24.x - Node.js 24 LTS \"Krypton\" (recommended)${normal}
+  * ${green}https://rpm.nodesource.com/setup_25.x - Node.js 25 (current)${normal}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* ${red}https://rpm.nodesource.com/setup_16.x - Node.js 16 \"Gallium\" ${bold}(deprecated)${normal}
* ${green}https://rpm.nodesource.com/setup_18.x - Node.js 18 \"Hydrogen\" (Maintenance)${normal}
* ${red}https://rpm.nodesource.com/setup_19.x - Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal}
* ${bold}${green}https://rpm.nodesource.com/setup_20.x - Node.js 20 LTS \"Iron\" (recommended)${normal}
* ${green}https://rpm.nodesource.com/setup_21.x - Node.js 21 \"Iron\" (current)${normal}
* ${red}https://rpm.nodesource.com/setup_16.x - Node.js 16 \"Gallium\" ${bold}(deprecated)${normal}
* ${red}https://rpm.nodesource.com/setup_18.x - Node.js 18 \"Hydrogen\" ${bold}(deprecated)${normal}
* ${red}https://rpm.nodesource.com/setup_19.x - Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal}
* ${green}https://rpm.nodesource.com/setup_20.x - Node.js 20 LTS \"Iron\" (Maintenance)${normal}
* ${green}https://rpm.nodesource.com/setup_22.x - Node.js 22 LTS \"Jod\" (Maintenance)${normal}
* ${bold}${green}https://rpm.nodesource.com/setup_24.x - Node.js 24 LTS \"Krypton\" (recommended)${normal}
* ${green}https://rpm.nodesource.com/setup_25.x - Node.js 25 (current)${normal}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/rpm/setup_16.x` around lines 69 - 73, The release-status lines in
scripts/rpm/setup_16.x are stale (the URL/status labels for setup_18.x,
setup_20.x, setup_21.x, etc.); update each URL line (e.g., the literal lines
containing "https://rpm.nodesource.com/setup_16.x",
"https://rpm.nodesource.com/setup_18.x",
"https://rpm.nodesource.com/setup_19.x",
"https://rpm.nodesource.com/setup_20.x",
"https://rpm.nodesource.com/setup_21.x") to reflect the current Node.js release
matrix as of 2026-03-09: mark 18.x and 21.x as EOL, mark 20.x and 22.x as
Maintenance LTS, add or mark 24.x as Active LTS and 25.x as Current, and adjust
colors/annotations (red/green/bold) accordingly so the recommended installer
points to the current LTS (24.x) or Current (25.x) as intended.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This modification only changes non-ASCII strings, will not effect users

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shouhuanxiaoji, you're correct — the change in this diff is purely cosmetic, replacing non-ASCII em dashes () with standard ASCII hyphens (-), and that won't affect users at runtime.

My concern about the stale Node.js release matrix (e.g., 18.x listed as Maintenance, 20.x as recommended, 21.x as current) is a pre-existing issue that predates this PR and is separate from your change. Would you like me to open a follow-up GitHub issue to track updating the deprecation warning's version list to reflect the current release status?

(ᓀ‸ᓂ)


🧠 Learnings used
Learnt from: alexio-dev
Repo: nodesource/distributions PR: 1873
File: README.md:265-279
Timestamp: 2025-07-15T16:29:59.102Z
Learning: DEB setup scripts incorrectly configure N|Solid preferences for all Node.js versions including non-LTS versions (21.x, 23.x, 24.x), while RPM scripts correctly only configure N|Solid for LTS versions (18.x, 20.x, 22.x). This inconsistency should be resolved by updating DEB scripts to match RPM behavior.

Learnt from: riosje
Repo: nodesource/distributions PR: 1862
File: scripts/rpm/setup_24.x:68-83
Timestamp: 2025-05-07T13:18:52.097Z
Learning: The N|Solid repository should only be configured for LTS versions of Node.js (currently 18.x, 20.x, and 22.x). Non-LTS versions like 24.x should not have the N|Solid repository configured.

Learnt from: shouhuanxiaoji
Repo: nodesource/distributions PR: 1926
File: scripts/rpm/script_generator/base_script.sh:35-38
Timestamp: 2026-03-09T13:32:24.267Z
Learning: In the nodesource/distributions repository, TencentOS has /etc/system-release (and /os-release at root, but NOT /etc/os-release). The RPM-based detection scripts (scripts/rpm/script_generator/base_script.sh and generated setup_*.x files) only check /etc/system-release for OS identification (consistent with Amazon Linux detection), which is sufficient for TencentOS and OpenCloudOS since both provide /etc/system-release.




Expand Down Expand Up @@ -104,7 +104,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
Comment on lines +107 to +110
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Check /os-release here too.

This guard has the same gap as the newer scripts: it only looks for TencentOS/OpenCloudOS in /etc/system-release, so machines identified via /os-release still fail the RPM-system check.

Suggested patch
-if ! [ -f /etc/redhat-release ] \
-   && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
-   && ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
-   && ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
+if ! [ -f /etc/redhat-release ] \
+   && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
+   && ! grep -Eqi "TencentOS|OpenCloudOS" /etc/system-release /os-release 2>/dev/null; then
     handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -Eqi "TencentOS|OpenCloudOS" /etc/system-release /os-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/rpm/setup_16.x` around lines 107 - 110, The guard in the if condition
that checks for non-RPM systems only inspects /etc/system-release and
/etc/redhat-release but misses distributions identified in /etc/os-release;
update the conditional around the multi-line if (the block starting with "if ! [
-f /etc/redhat-release ] \") to also check /etc/os-release for the same strings
("Amazon Linux", "TencentOS", "OpenCloudOS") using grep -q /etc/os-release
2>/dev/null (case-insensitively where used) so machines identified via
/etc/os-release are correctly detected and the RPM-system check behaves the same
as newer scripts.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the original code only checks /etc/system-release for Amazon Linux, it does not add the callback's /etc/os-release check.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shouhuanxiaoji, that's a fair point — the existing pattern consistently uses /etc/system-release for Amazon Linux detection, and since TencentOS and OpenCloudOS both provide /etc/system-release, applying the same check there is the correct and consistent approach. My suggestion to also check /os-release was misaligned with this established convention. Apologies for the noise!


🧠 Learnings used
Learnt from: shouhuanxiaoji
Repo: nodesource/distributions PR: 1926
File: scripts/rpm/script_generator/base_script.sh:35-38
Timestamp: 2026-03-09T13:32:24.267Z
Learning: In the nodesource/distributions repository, TencentOS has /etc/system-release (and /os-release at root, but NOT /etc/os-release). The RPM-based detection scripts (scripts/rpm/script_generator/base_script.sh and generated setup_*.x files) only check /etc/system-release for OS identification (consistent with Amazon Linux detection), which is sufficient for TencentOS and OpenCloudOS since both provide /etc/system-release.

Learnt from: alexio-dev
Repo: nodesource/distributions PR: 1873
File: README.md:265-279
Timestamp: 2025-07-15T16:29:59.102Z
Learning: DEB setup scripts incorrectly configure N|Solid preferences for all Node.js versions including non-LTS versions (21.x, 23.x, 24.x), while RPM scripts correctly only configure N|Solid for LTS versions (18.x, 20.x, 22.x). This inconsistency should be resolved by updating DEB scripts to match RPM behavior.

handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi
node_deprecation_warning
Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_18.x
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_20.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_21.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_22.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_23.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_24.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_25.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_current.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down
5 changes: 4 additions & 1 deletion scripts/rpm/setup_lts.x
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ command_exists() {
}

# Check if we are on an RPM-based system
if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then
if ! [ -f /etc/redhat-release ] \
&& ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null \
&& ! grep -qi "TencentOS" /etc/system-release 2>/dev/null \
&& ! grep -qi "OpenCloudOS" /etc/system-release 2>/dev/null; then
handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system."
fi

Expand Down