mirror of
https://github.com/nushell/nushell.git
synced 2025-01-05 05:50:14 +01:00
cp
: disable unsupported reflink mode in freebsd builds (#14677)
Fixes #12627 # User-Facing Changes Under FreeBSD, `cp` no longer errors with "--reflink is only supported on linux and macOS". # Tests The `commands::ucp` tests now pass on a FreeBSD 14.2 machine with ZFS.
This commit is contained in:
parent
0a0475ebad
commit
38694a9850
@ -142,19 +142,9 @@ impl Command for UCp {
|
|||||||
} else {
|
} else {
|
||||||
uu_cp::OverwriteMode::Clobber(uu_cp::ClobberMode::Standard)
|
uu_cp::OverwriteMode::Clobber(uu_cp::ClobberMode::Standard)
|
||||||
};
|
};
|
||||||
#[cfg(any(
|
#[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))]
|
||||||
target_os = "linux",
|
|
||||||
target_os = "freebsd",
|
|
||||||
target_os = "android",
|
|
||||||
target_os = "macos"
|
|
||||||
))]
|
|
||||||
let reflink_mode = uu_cp::ReflinkMode::Auto;
|
let reflink_mode = uu_cp::ReflinkMode::Auto;
|
||||||
#[cfg(not(any(
|
#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "macos")))]
|
||||||
target_os = "linux",
|
|
||||||
target_os = "freebsd",
|
|
||||||
target_os = "android",
|
|
||||||
target_os = "macos"
|
|
||||||
)))]
|
|
||||||
let reflink_mode = uu_cp::ReflinkMode::Never;
|
let reflink_mode = uu_cp::ReflinkMode::Never;
|
||||||
let mut paths = call.rest::<Spanned<NuGlob>>(engine_state, stack, 0)?;
|
let mut paths = call.rest::<Spanned<NuGlob>>(engine_state, stack, 0)?;
|
||||||
if paths.is_empty() {
|
if paths.is_empty() {
|
||||||
|
@ -894,13 +894,19 @@ fn test_cp_debug_default() {
|
|||||||
{
|
{
|
||||||
panic!("{}", format!("Failure: stdout was \n{}", actual.out));
|
panic!("{}", format!("Failure: stdout was \n{}", actual.out));
|
||||||
}
|
}
|
||||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
#[cfg(target_os = "linux")]
|
||||||
if !actual
|
if !actual
|
||||||
.out
|
.out
|
||||||
.contains("copy offload: yes, reflink: unsupported, sparse detection: no")
|
.contains("copy offload: yes, reflink: unsupported, sparse detection: no")
|
||||||
{
|
{
|
||||||
panic!("{}", format!("Failure: stdout was \n{}", actual.out));
|
panic!("{}", format!("Failure: stdout was \n{}", actual.out));
|
||||||
}
|
}
|
||||||
|
#[cfg(target_os = "freebsd")]
|
||||||
|
if !actual.out.contains(
|
||||||
|
"copy offload: unsupported, reflink: unsupported, sparse detection: unsupported",
|
||||||
|
) {
|
||||||
|
panic!("{}", format!("Failure: stdout was \n{}", actual.out));
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
if !actual.out.contains(
|
if !actual.out.contains(
|
||||||
|
Loading…
Reference in New Issue
Block a user