Skip to content

Commit 0dc8a65

Browse files
committed
uucore: drop runtime branding env override; rely on automatic detection
Remove UUTILS_VERSION_BRAND runtime override path. Keep compile-time option_env! for packagers if needed. Tests updated to remove env override case; autoconf compatibility still validated via autoconf-like env hints. fmt/clippy/tests green.
1 parent ab70974 commit 0dc8a65

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

src/uucore/src/lib/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,6 @@ fn get_runtime_brand() -> String {
343343
return brand.to_string();
344344
}
345345

346-
// Check for runtime environment variable override
347-
if let Ok(brand) = env::var("UUTILS_VERSION_BRAND") {
348-
return brand;
349-
}
350-
351346
// If likely under autoconf probe for mkdir, use GNU branding for compatibility
352347
if should_emit_gnu_brand() {
353348
return "GNU coreutils".to_string();
@@ -364,7 +359,7 @@ pub fn brand_version_static(brand: &'static str, version: &'static str) -> &'sta
364359

365360
/// Generate version string with runtime autoconf detection
366361
pub fn runtime_version_string(_version: &'static str) -> &'static str {
367-
static VERSION_CACHE: LazyLock<String> = LazyLock::new(|| {
362+
static VERSION_CACHE: LazyLock<String> = LazyLock::new(|| {
368363
let brand = get_runtime_brand();
369364
format!("({brand}) {}", env!("CARGO_PKG_VERSION"))
370365
});

tests/by-util/test_mkdir.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ fn test_version_format_autoconf_compatibility() {
3131
.stdout_contains("(GNU coreutils)");
3232
}
3333

34-
#[test]
35-
fn test_runtime_autoconf_detection_with_env_var() {
36-
// Test explicit environment variable override
37-
let mut cmd = new_ucmd!();
38-
cmd.env("UUTILS_VERSION_BRAND", "GNU coreutils")
39-
.arg("--version")
40-
.succeeds()
41-
.stdout_contains("(GNU coreutils)");
42-
}
43-
4434
#[test]
4535
fn test_runtime_autoconf_detection_with_configure_env() {
4636
// Test autoconf environment variable detection

0 commit comments

Comments
 (0)