mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 08:48:23 +01:00
Allow building on NetBSD (#11823)
Fixes https://github.com/nushell/nushell/issues/11814
This commit is contained in:
parent
5042f19d1b
commit
005b8b02b2
@ -281,7 +281,12 @@ const ATTR_SET: uu_cp::Preserve = uu_cp::Preserve::Yes { required: true };
|
||||
fn make_attributes(preserve: Option<Value>) -> Result<uu_cp::Attributes, ShellError> {
|
||||
if let Some(preserve) = preserve {
|
||||
let mut attributes = uu_cp::Attributes {
|
||||
#[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))]
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "android",
|
||||
target_os = "macos",
|
||||
target_os = "netbsd"
|
||||
))]
|
||||
ownership: ATTR_UNSET,
|
||||
mode: ATTR_UNSET,
|
||||
timestamps: ATTR_UNSET,
|
||||
@ -296,7 +301,12 @@ fn make_attributes(preserve: Option<Value>) -> Result<uu_cp::Attributes, ShellEr
|
||||
// By default preseerve only mode
|
||||
Ok(uu_cp::Attributes {
|
||||
mode: ATTR_SET,
|
||||
#[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))]
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "android",
|
||||
target_os = "macos",
|
||||
target_os = "netbsd"
|
||||
))]
|
||||
ownership: ATTR_UNSET,
|
||||
timestamps: ATTR_UNSET,
|
||||
context: ATTR_UNSET,
|
||||
@ -332,7 +342,12 @@ fn parse_and_set_attribute(
|
||||
Value::String { val, .. } => {
|
||||
let attribute = match val.as_str() {
|
||||
"mode" => &mut attribute.mode,
|
||||
#[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))]
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "android",
|
||||
target_os = "macos",
|
||||
target_os = "netbsd"
|
||||
))]
|
||||
"ownership" => &mut attribute.ownership,
|
||||
"timestamps" => &mut attribute.timestamps,
|
||||
"context" => &mut attribute.context,
|
||||
|
Loading…
Reference in New Issue
Block a user