Skip to content

fix: recognise Rocky/Alma/CentOS Stream lsb_release IDs in is_redhat - #1664

Open
stantheman0128 wants to merge 2 commits into
RexOps:masterfrom
stantheman0128:is-redhat-lsb-ids
Open

stantheman0128 wants to merge 2 commits into
RexOps:masterfrom
stantheman0128:is-redhat-lsb-ids

Conversation

@stantheman0128

Copy link
Copy Markdown

This pull request proposes to fix #1661 by adding current RHEL-rebuild lsb_release IDs to @redhat_clones and comparing OS names exactly (case-insensitive) instead of as an unanchored regex.

Please review, then either merge, or let me know how to improve it further.

prepared with Cursor

Checklist towards merging

  • (re)based on top of latest source code
  • has changelog entry
  • automated tests pass
  • has clean git history
  • has well-written commit messages

Verification

Reproduced the list gap on this Mac by calling is_redhat with an explicit OS argument (no Rocky host required):

Rocky => 0
RockyLinux => 0
AlmaLinux => 0
CentOSStream => 0
OracleLinux => 0
Red => 1   # false positive from unanchored /$os/

After the fix:

perl t/is_redhat.t
ok 1..12

Rocky, AlmaLinux, and friends return true; Red and Debian return false.

Made with Cursor

lsb_release -s -i on current RHEL rebuilds reports IDs missing from
@redhat_clones, so pkg lookups died once redhat-lsb-core was installed.
Match the OS name exactly so substrings like Red no longer false-match.

Fixes RexOps#1661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

is_redhat() misses Rocky/Alma/CentOS Stream/Oracle Linux lsb_release IDs -> pkg dies "OS/Provider not supported"

1 participant