Skip to content

Commit 4b97dc1

Browse files
authored
Merge pull request bootc-dev#467 from cgwalters/update-ostree-bindings
Update to ostree 0.18
2 parents 8cd93fb + a880fd0 commit 4b97dc1

File tree

9 files changed

+17
-18
lines changed

9 files changed

+17
-18
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
env:
1717
CARGO_TERM_COLOR: always
1818
# Pinned toolchain for linting
19-
ACTION_LINTS_TOOLCHAIN: 1.63.0
19+
ACTION_LINTS_TOOLCHAIN: 1.64.0
2020

2121
jobs:
2222
tests:

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
77
repository = "https://github.com/ostreedev/ostree-rs-ext"
88
readme = "README.md"
99
publish = false
10-
rust-version = "1.63.0"
10+
rust-version = "1.64.0"
1111

1212
[dependencies]
1313
anyhow = "1.0"

lib/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "ostree-ext"
77
readme = "README.md"
88
repository = "https://github.com/ostreedev/ostree-rs-ext"
99
version = "0.10.7"
10-
rust-version = "1.63.0"
10+
rust-version = "1.64.0"
1111

1212
[dependencies]
1313
anyhow = "1.0"
@@ -33,7 +33,7 @@ libc = "0.2.92"
3333
libsystemd = "0.5.0"
3434
oci-spec = "0.5.4"
3535
openssl = "0.10.33"
36-
ostree = { features = ["v2022_5", "cap-std-apis"], version = "0.17.0" }
36+
ostree = { features = ["v2022_5", "cap-std-apis"], version = "0.18.0" }
3737
pin-project = "1.0"
3838
regex = "1.5.4"
3939
serde = { features = ["derive"], version = "1.0.125" }

lib/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ where
871871
} => {
872872
let sysroot = &ostree::Sysroot::new(Some(&gio::File::for_path(&sysroot)));
873873
sysroot.load(gio::Cancellable::NONE)?;
874-
let repo = &sysroot.repo().unwrap();
874+
let repo = &sysroot.repo();
875875
let kargs = karg.as_deref();
876876
let kargs = kargs.map(|v| {
877877
let r: Vec<_> = v.iter().map(|s| s.as_str()).collect();

lib/src/container/deploy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub async fn deploy(
5151
) -> Result<Box<LayeredImageState>> {
5252
let cancellable = ostree::gio::Cancellable::NONE;
5353
let options = options.unwrap_or_default();
54-
let repo = &sysroot.repo().unwrap();
54+
let repo = &sysroot.repo();
5555
let merge_deployment = sysroot.merge_deployment(Some(stateroot));
5656
let mut imp =
5757
super::store::ImageImporter::new(repo, imgref, options.proxy_cfg.unwrap_or_default())

lib/src/container/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ pub fn merge_default_container_proxy_opts(
315315
) -> Result<()> {
316316
let user = cap_std_ext::rustix::process::getuid()
317317
.is_root()
318-
.then(|| isolation::DEFAULT_UNPRIVILEGED_USER);
318+
.then_some(isolation::DEFAULT_UNPRIVILEGED_USER);
319319
merge_default_container_proxy_opts_with_isolation(config, user)
320320
}
321321

@@ -341,7 +341,7 @@ pub fn merge_default_container_proxy_opts_with_isolation(
341341
let isolation_user = config
342342
.skopeo_cmd
343343
.is_none()
344-
.then(|| isolation_user.as_ref())
344+
.then_some(isolation_user.as_ref())
345345
.flatten();
346346
if let Some(user) = isolation_user {
347347
// Read the default authfile if it exists and pass it via file descriptor

lib/src/diff.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,20 @@ fn diff_recurse(
101101
from_child.ensure_resolved()?;
102102

103103
if is_dir {
104-
let from_contents_checksum =
105-
from_child.tree_get_contents_checksum().expect("checksum");
106-
let to_contents_checksum = to_child.tree_get_contents_checksum().expect("checksum");
104+
let from_contents_checksum = from_child.tree_get_contents_checksum();
105+
let to_contents_checksum = to_child.tree_get_contents_checksum();
107106
if from_contents_checksum != to_contents_checksum {
108107
let subpath = format!("{}/", path);
109108
diff_recurse(&subpath, diff, &from_child, &to_child)?;
110109
}
111-
let from_meta_checksum = from_child.tree_get_metadata_checksum().expect("checksum");
112-
let to_meta_checksum = to_child.tree_get_metadata_checksum().expect("checksum");
110+
let from_meta_checksum = from_child.tree_get_metadata_checksum();
111+
let to_meta_checksum = to_child.tree_get_metadata_checksum();
113112
if from_meta_checksum != to_meta_checksum {
114113
diff.changed_dirs.insert(path);
115114
}
116115
} else {
117-
let from_checksum = from_child.checksum().expect("checksum");
118-
let to_checksum = to_child.checksum().expect("checksum");
116+
let from_checksum = from_child.checksum();
117+
let to_checksum = to_child.checksum();
119118
if from_checksum != to_checksum {
120119
diff.changed_files.insert(path);
121120
}

lib/src/fixture.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn create_dirmeta(path: &Utf8Path, selinux: bool) -> glib::Variant {
241241
None
242242
};
243243
let xattrs = label.map(|v| v.new_xattrs());
244-
ostree::create_directory_metadata(&finfo, xattrs.as_ref()).unwrap()
244+
ostree::create_directory_metadata(&finfo, xattrs.as_ref())
245245
}
246246

247247
/// Wraps [`create_dirmeta`] and commits it.
@@ -320,7 +320,7 @@ fn build_mapping_recurse(
320320
});
321321
}
322322

323-
let checksum = child.checksum().unwrap().to_string();
323+
let checksum = child.checksum().to_string();
324324
match ret.map.entry(checksum) {
325325
Entry::Vacant(v) => {
326326
v.insert(owner);

lib/src/tar/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ impl Importer {
752752
finfo.set_attribute_uint32("unix::gid", 0);
753753
finfo.set_attribute_uint32("unix::mode", libc::S_IFDIR | 0o755);
754754
// SAFETY: TODO: This is not a nullable return, fix it in ostree
755-
ostree::create_directory_metadata(&finfo, None).unwrap()
755+
ostree::create_directory_metadata(&finfo, None)
756756
}
757757

758758
pub(crate) fn finish_import_object_set(self) -> Result<String> {

0 commit comments

Comments
 (0)