Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ uptime = { optional = true, version = "0.13.0", package = "uu_uptime", path = "s
users = { optional = true, version = "0.13.0", package = "uu_users", path = "src/uu/users" }
vdir = { optional = true, version = "0.13.0", package = "uu_vdir", path = "src/uu/vdir" }
wc = { optional = true, version = "0.13.0", package = "uu_wc", path = "src/uu/wc" }
who = { optional = true, version = "0.13.0", package = "uu_who", path = "src/uu/who" }
whoami = { optional = true, version = "0.13.0", package = "uu_whoami", path = "src/uu/whoami" }
yes = { optional = true, version = "0.13.0", package = "uu_yes", path = "src/uu/yes" }

Expand Down Expand Up @@ -396,6 +395,9 @@ runcon = { optional = true, version = "0.13.0", package = "uu_runcon", path = "s
# Not needed for now. Keep as examples:
#pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)

[target.'cfg(any(target_vendor = "apple", target_os = "cygwin", target_os = "freebsd", target_os = "linux", target_os = "netbsd"))'.dependencies]
who = { optional = true, version = "0.13.0", package = "uu_who", path = "src/uu/who" }

[target.'cfg(all(unix, not(target_os = "fuchsia")))'.dev-dependencies]
rlimit = { workspace = true }

Expand Down
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub fn main() {
let out_dir = env::var("OUT_DIR").unwrap();

let target_os = env::var_os("CARGO_CFG_TARGET_OS").unwrap();
let target_vendor = env::var_os("CARGO_CFG_TARGET_VENDOR").unwrap();
for (key, val) in env::vars() {
if val == "1" && key.starts_with(ENV_FEATURE_PREFIX) {
let krate = key[ENV_FEATURE_PREFIX.len()..].to_lowercase();
Expand All @@ -50,6 +51,15 @@ pub fn main() {
"chcon" | "runcon" if !(target_os == "linux" || target_os == "android") => {
continue;
}
"who"
if !(target_vendor == "apple"
|| target_os == "cygwin"
|| target_os == "freebsd"
|| target_os == "linux"
|| target_os == "netbsd") =>
{
continue;
}
"default" | "macos" | "unix" | "windows" | "selinux" | "zip" | "clap_complete"
| "clap_mangen" | "fluent_syntax" | "openssl" => continue, // common/standard feature names
"nightly" | "test_unimplemented" | "expensive_tests" | "test_risky_names" => {
Expand Down
3 changes: 2 additions & 1 deletion src/uu/who/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/who.rs"
test = false
doctest = false

[dependencies]
[target.'cfg(any(target_vendor = "apple", target_os = "cygwin", target_os = "freebsd", target_os = "linux", target_os = "netbsd"))'.dependencies]
clap = { workspace = true }
fluent = { workspace = true }
rustix = { workspace = true, features = ["fs", "termios"] }
Expand All @@ -33,3 +33,4 @@ workspace = true
[[bin]]
name = "who"
path = "src/main.rs"
required-features = ["uucore/default"]
3 changes: 0 additions & 3 deletions src/uu/who/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,3 @@ who-heading-exit = EXIT

# Error messages
who-canonicalize-error = failed to canonicalize { $host }

# Platform-specific messages
who-unsupported-openbsd = unsupported command on OpenBSD
3 changes: 0 additions & 3 deletions src/uu/who/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,3 @@ who-heading-exit = SORTIE

# Error messages
who-canonicalize-error = échec de canonicalisation de { $host }

# Platform-specific messages
who-unsupported-openbsd = commande non prise en charge sur OpenBSD
8 changes: 1 addition & 7 deletions src/uu/who/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

#[cfg(not(target_os = "openbsd"))]
mod unix;
Comment thread
xtqqczze marked this conversation as resolved.
Resolved
#[cfg(not(target_os = "openbsd"))]
pub use self::unix::*;

#[cfg(target_os = "openbsd")]
mod openbsd;
#[cfg(target_os = "openbsd")]
pub use self::openbsd::*;
pub use self::unix::*;
17 changes: 0 additions & 17 deletions src/uu/who/src/platform/openbsd.rs

This file was deleted.

8 changes: 8 additions & 0 deletions src/uu/who/src/who.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@

// spell-checker:ignore (ToDO) runlevel mesg

#![cfg(any(
Comment thread
xtqqczze marked this conversation as resolved.
Resolved
target_vendor = "apple",
target_os = "cygwin",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd"
))]

use clap::{Arg, ArgAction, Command};
use uucore::format_usage;
use uucore::translate;
Expand Down
8 changes: 8 additions & 0 deletions tests/by-util/test_who.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@

// spell-checker:ignore (flags) runlevel mesg

#![cfg(any(
target_vendor = "apple",
target_os = "cygwin",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd"
))]

use uutests::new_ucmd;
use uutests::unwrap_or_return;
use uutests::util::{TestScenario, expected_result, gnu_cmd_result};
Expand Down
Loading