Skip to content
Merged
Changes from all 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
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,11 @@ namespace Version {
const line = output.split('\n', 1)[0];
// Require some confirmation this is [e]glibc, and a plausible

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

By the way, the [e] here was deliberate, it's a reference to https://github.com/Xilinx/eglibc, please keep it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The irony is that just earlier I referenced Chesterton's fence

// version number.
const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i);
const match = line.match(/^ldd .*(?:GNU |g)libc.* (\d+(?:\.\d+)+)[^ ]*$/i);
if (!match || !semver.validRange(match[1], loose)) {
console.error(`Can't glibc version from ldd --version output: ${line}`);
console.error(
`Can't determine glibc version from ldd --version output: ${line}`,
);
return null;
}
const version = new semver.Range(match[1], loose);
Expand Down