Make release delimiter matching case-insensitive in lsb_release#7
Open
yueyuankun wants to merge 1 commit intoLinuxStandardBase:masterfrom
Open
Make release delimiter matching case-insensitive in lsb_release#7yueyuankun wants to merge 1 commit intoLinuxStandardBase:masterfrom
yueyuankun wants to merge 1 commit intoLinuxStandardBase:masterfrom
Conversation
The lsb_release script currently only matches lowercase release when parsing distribution description strings from /etc/*-release files. This causes it to fail on distributions that use Release with a capital R, resulting in n/a for Distributor ID, Release, and Codename fields. For example, with a release file containing: "Linux Advanced Server Release Hello (Hi)" Before this fix: Distributor ID: n/a Release: n/a Codename: n/a After this fix: Distributor ID: LinuxAdvancedServer Release: Hello Codename: Hi This change adds the I (case-insensitive) flag to all sed commands that match DESCSTR_DELI, making the script more robust and compatible with both "release" and "Release" formats used by different distributions. The modification maintains backward compatibility with existing distributions that use lowercase "release" while also supporting those that use capitalized "Release".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lsb_release script currently only matches lowercase release when parsing distribution description strings from /etc/*-release files. This causes it to fail on distributions that use Release with a capital R, resulting in n/a for Distributor ID, Release, and Codename fields.
For example, with a release file containing:
"Linux Advanced Server Release Hello (Hi)"
Before this fix:
Distributor ID: n/a
Release: n/a
Codename: n/a
After this fix:
Distributor ID: LinuxAdvancedServer
Release: Hello
Codename: Hi
This change adds the I (case-insensitive) flag to all sed commands that match DESCSTR_DELI, making the script more robust and compatible with both "release" and "Release" formats used by different distributions.
The modification maintains backward compatibility with existing distributions that use lowercase "release"
while also supporting those that use capitalized "Release".
Changes: