mirror of
https://github.com/nushell/nushell.git
synced 2025-06-20 01:48:09 +02: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> {
|
fn make_attributes(preserve: Option<Value>) -> Result<uu_cp::Attributes, ShellError> {
|
||||||
if let Some(preserve) = preserve {
|
if let Some(preserve) = preserve {
|
||||||
let mut attributes = uu_cp::Attributes {
|
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,
|
ownership: ATTR_UNSET,
|
||||||
mode: ATTR_UNSET,
|
mode: ATTR_UNSET,
|
||||||
timestamps: 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
|
// By default preseerve only mode
|
||||||
Ok(uu_cp::Attributes {
|
Ok(uu_cp::Attributes {
|
||||||
mode: ATTR_SET,
|
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,
|
ownership: ATTR_UNSET,
|
||||||
timestamps: ATTR_UNSET,
|
timestamps: ATTR_UNSET,
|
||||||
context: ATTR_UNSET,
|
context: ATTR_UNSET,
|
||||||
@ -332,7 +342,12 @@ fn parse_and_set_attribute(
|
|||||||
Value::String { val, .. } => {
|
Value::String { val, .. } => {
|
||||||
let attribute = match val.as_str() {
|
let attribute = match val.as_str() {
|
||||||
"mode" => &mut attribute.mode,
|
"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,
|
"ownership" => &mut attribute.ownership,
|
||||||
"timestamps" => &mut attribute.timestamps,
|
"timestamps" => &mut attribute.timestamps,
|
||||||
"context" => &mut attribute.context,
|
"context" => &mut attribute.context,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user