mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
Merge pull request #7003 from sylvestre/use-func
cp: use the function from uucore
This commit is contained in:
commit
6478f68c5a
4 changed files with 6 additions and 8 deletions
|
@ -30,6 +30,7 @@ uucore = { workspace = true, features = [
|
|||
"backup-control",
|
||||
"entries",
|
||||
"fs",
|
||||
"fsxattr",
|
||||
"perms",
|
||||
"mode",
|
||||
"update-control",
|
||||
|
|
|
@ -17,6 +17,8 @@ use std::os::unix::ffi::OsStrExt;
|
|||
#[cfg(unix)]
|
||||
use std::os::unix::fs::{FileTypeExt, PermissionsExt};
|
||||
use std::path::{Path, PathBuf, StripPrefixError};
|
||||
#[cfg(all(unix, not(target_os = "android")))]
|
||||
use uucore::fsxattr::copy_xattrs;
|
||||
|
||||
use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command};
|
||||
use filetime::FileTime;
|
||||
|
@ -1605,12 +1607,7 @@ pub(crate) fn copy_attributes(
|
|||
handle_preserve(&attributes.xattr, || -> CopyResult<()> {
|
||||
#[cfg(all(unix, not(target_os = "android")))]
|
||||
{
|
||||
let xattrs = xattr::list(source)?;
|
||||
for attr in xattrs {
|
||||
if let Some(attr_value) = xattr::get(source, attr.clone())? {
|
||||
xattr::set(dest, attr, &attr_value[..])?;
|
||||
}
|
||||
}
|
||||
copy_xattrs(source, dest)?;
|
||||
}
|
||||
#[cfg(not(all(unix, not(target_os = "android"))))]
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ pub mod process;
|
|||
#[cfg(all(target_os = "linux", feature = "tty"))]
|
||||
pub mod tty;
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), feature = "fsxattr"))]
|
||||
#[cfg(all(unix, feature = "fsxattr"))]
|
||||
pub mod fsxattr;
|
||||
#[cfg(all(unix, not(target_os = "fuchsia"), feature = "signals"))]
|
||||
pub mod signals;
|
||||
|
|
|
@ -99,7 +99,7 @@ pub use crate::features::wide;
|
|||
#[cfg(feature = "fsext")]
|
||||
pub use crate::features::fsext;
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), feature = "fsxattr"))]
|
||||
#[cfg(all(unix, feature = "fsxattr"))]
|
||||
pub use crate::features::fsxattr;
|
||||
|
||||
//## core functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue