mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-05 11:40:04 +00:00
Rename parse_libc_version
to parse_libc_version_from_ldd_output
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
7232f32428
commit
8bf4d187ee
1 changed files with 9 additions and 8 deletions
|
@ -56,7 +56,8 @@ mod linux {
|
||||||
stderr,
|
stderr,
|
||||||
}) = Command::new("ldd").arg("--version").output().await
|
}) = Command::new("ldd").arg("--version").output().await
|
||||||
{
|
{
|
||||||
let libc_version = if let Some(libc_version) = parse_libc_version(stdout) {
|
let libc_version =
|
||||||
|
if let Some(libc_version) = parse_libc_version_from_ldd_output(stdout) {
|
||||||
libc_version
|
libc_version
|
||||||
} else if let Some(libc_version) = parse_libc_version(stderr) {
|
} else if let Some(libc_version) = parse_libc_version(stderr) {
|
||||||
libc_version
|
libc_version
|
||||||
|
@ -76,7 +77,7 @@ mod linux {
|
||||||
from_array([create_target_str("musl", abi)])
|
from_array([create_target_str("musl", abi)])
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_libc_version(output: &[u8]) -> Option<&'static str> {
|
fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> {
|
||||||
let s = String::from_utf8_lossy(output);
|
let s = String::from_utf8_lossy(output);
|
||||||
if s.contains("musl libc") {
|
if s.contains("musl libc") {
|
||||||
Some("musl")
|
Some("musl")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue