Skip to content

Commit 9eb83a4

Browse files
committed
cp: add acl cfg alias
1 parent 85283e2 commit 9eb83a4

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/cp/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ workspace = true
1717
[lib]
1818
path = "src/cp.rs"
1919

20+
[build-dependencies]
21+
cfg_aliases = "0.2.1"
22+
2023
[dependencies]
2124
clap = { workspace = true }
2225
filetime = { workspace = true }

src/uu/cp/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is part of the uutils coreutils package.
2+
//
3+
// For the full copyright and license information, please view the LICENSE
4+
// file that was distributed with this source code.
5+
6+
use cfg_aliases::cfg_aliases;
7+
8+
pub fn main() {
9+
cfg_aliases! {
10+
acl: { feature = "feat_acl" },
11+
}
12+
}

src/uu/cp/src/cp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ pub(crate) fn copy_attributes(
17691769
fs::set_permissions(dest, source_metadata.permissions())
17701770
.map_err(|e| CpError::IoErrContext(e, context.to_owned()))?;
17711771
// FIXME: Implement this for windows as well
1772-
#[cfg(feature = "feat_acl")]
1772+
#[cfg(acl)]
17731773
exacl::getfacl(source, None)
17741774
.and_then(|acl| exacl::setfacl(&[dest], &acl, None))
17751775
.map_err(|err| CpError::Error(err.to_string()))?;

0 commit comments

Comments
 (0)