mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
Merge pull request #532 from bket/fix_build_openbsd
OpenBSD does not support extended file attributes
This commit is contained in:
commit
cd356e9146
@ -91,6 +91,8 @@ rhai = {version = "1.13", features = ["sync", "serde", "no_optimize", "no_module
|
||||
|
||||
[target.'cfg(not(windows))'.dependencies]
|
||||
users = "0.11"
|
||||
|
||||
[target.'cfg(not(any(windows, target_os="openbsd")))'.dependencies]
|
||||
xattr = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@ -3,6 +3,7 @@ Changes in version x.x.x:
|
||||
Breaking changes:
|
||||
|
||||
Bugs fixed:
|
||||
- Fixed compiliation on OpenBSD.
|
||||
|
||||
New features:
|
||||
- REST backend: Set User-Agent header
|
||||
|
||||
@ -17,7 +17,7 @@ use serde_with::{serde_as, DisplayFromStr};
|
||||
#[cfg(not(windows))]
|
||||
use users::{Groups, Users, UsersCache};
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(not(any(windows, target_os = "openbsd")))]
|
||||
use super::node::ExtendedAttribute;
|
||||
use super::node::{Metadata, NodeType};
|
||||
use super::{Node, ReadSource, ReadSourceEntry, ReadSourceOpen};
|
||||
@ -325,15 +325,21 @@ fn map_entry(
|
||||
let device_id = if ignore_devid { 0 } else { m.dev() };
|
||||
let links = if m.is_dir() { 0 } else { m.nlink() };
|
||||
|
||||
let path = entry.path();
|
||||
let extended_attributes = xattr::list(path)?
|
||||
.map(|name| {
|
||||
Ok(ExtendedAttribute {
|
||||
name: name.to_string_lossy().to_string(),
|
||||
value: xattr::get(path, name)?.unwrap(),
|
||||
#[cfg(target_os = "openbsd")]
|
||||
let extended_attributes = vec![];
|
||||
|
||||
#[cfg(not(target_os = "openbsd"))]
|
||||
let extended_attributes = {
|
||||
let path = entry.path();
|
||||
xattr::list(path)?
|
||||
.map(|name| {
|
||||
Ok(ExtendedAttribute {
|
||||
name: name.to_string_lossy().to_string(),
|
||||
value: xattr::get(path, name)?.unwrap(),
|
||||
})
|
||||
})
|
||||
})
|
||||
.collect::<Result<_>>()?;
|
||||
.collect::<Result<_>>()?
|
||||
};
|
||||
|
||||
let meta = Metadata {
|
||||
size,
|
||||
|
||||
@ -324,7 +324,7 @@ impl LocalDestination {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(any(windows, target_os = "openbsd"))]
|
||||
pub fn set_extended_attributes(
|
||||
&self,
|
||||
_item: impl AsRef<Path>,
|
||||
@ -333,7 +333,7 @@ impl LocalDestination {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(not(any(windows, target_os = "openbsd")))]
|
||||
pub fn set_extended_attributes(
|
||||
&self,
|
||||
item: impl AsRef<Path>,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user