mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-05 03:30:03 +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,13 +56,14 @@ 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 =
|
||||||
libc_version
|
if let Some(libc_version) = parse_libc_version_from_ldd_output(stdout) {
|
||||||
} else if let Some(libc_version) = parse_libc_version(stderr) {
|
libc_version
|
||||||
libc_version
|
} else if let Some(libc_version) = parse_libc_version(stderr) {
|
||||||
} else {
|
libc_version
|
||||||
return from_array([create_target_str("musl", abi)]);
|
} else {
|
||||||
};
|
return from_array([create_target_str("musl", abi)]);
|
||||||
|
};
|
||||||
|
|
||||||
if libc_version == "gnu" {
|
if libc_version == "gnu" {
|
||||||
return from_array([
|
return from_array([
|
||||||
|
@ -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