Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to ostree-ext 0.20, cap-std-ext 2.0
Browse files Browse the repository at this point in the history
- ostree-ext updates to new ostree, so adjust our usage of the
  ostree crate
- Also adjust for changed ostree-ext APIs
- ostree-ext now re-exports cap-std-ext 2.0, which stopped re-exporting
  rustix, so depend on that directly
RishabhSaini authored and cgwalters committed May 23, 2023

Verified

This commit was signed with the committer’s verified signature.
Lehmann-Fabian Fabian Lehmann
1 parent dfd3d7f commit 2c944d4
Showing 21 changed files with 81 additions and 161 deletions.
129 changes: 34 additions & 95 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -45,12 +45,12 @@ anyhow = "1.0.69"
binread = "2.2.0"
bitflags = "2.3"
camino = "1.1.1"
cap-std-ext = "1.0"
cap-std-ext = "2.0"
cap-std = { version = "1.0.3", features = ["fs_utf8"] }
containers-image-proxy = "0.5.1"
# Explicitly force on libc
rustix = { version = "0.36", features = ["use-libc"] }
cap-primitives = "1.0.15"
rustix = { version = "0.37", features = ["use-libc"] }
cap-primitives = "1.0.3"
cap-tempfile = "1.0.1"
chrono = { version = "0.4.23", features = ["serde"] }
clap = { version = "4.3", features = ["derive"] }
@@ -72,7 +72,7 @@ nix = "0.26.1"
openssl = "0.10.49"
once_cell = "1.16.0"
os-release = "0.1.0"
ostree-ext = "0.10.0"
ostree-ext = "0.11.0"
paste = "1.0"
phf = { version = "0.11", features = ["macros"] }
rand = "0.8.5"
6 changes: 3 additions & 3 deletions rust/src/builtins/apply_live.rs
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ fn get_args_variant(sysroot: &ostree::Sysroot, opts: &Opts) -> Result<glib::Vari
} else if opts.reset {
let booted = sysroot.require_booted_deployment()?;
// Unwrap safety: This can't return NULL
let csum = booted.csum().expect("csum");
let csum = booted.csum();
r.insert(live::OPT_TARGET, &csum.as_str());
}

@@ -76,9 +76,9 @@ pub(crate) fn applylive_finish(sysroot: &crate::ffi::OstreeSysroot) -> CxxResult
let sysroot = sysroot.glib_reborrow();
let cancellable = gio::Cancellable::NONE;
sysroot.load_if_changed(cancellable)?;
let repo = &sysroot.repo().unwrap();
let repo = &sysroot.repo();
let booted = &sysroot.require_booted_deployment()?;
let booted_commit = booted.csum().expect("csum");
let booted_commit = booted.csum();
let booted_commit = booted_commit.as_str();

let live_state = live::get_live_state(repo, booted)?
3 changes: 1 addition & 2 deletions rust/src/builtins/compose/mod.rs
Original file line number Diff line number Diff line change
@@ -9,9 +9,8 @@ use anyhow::{Context, Result};
use cap_std::fs::{Dir, DirBuilder, Permissions};
use cap_std_ext::cap_std;
use cap_std_ext::dirext::CapStdExtDirExt;
use cap_std_ext::rustix;
use cap_std_ext::rustix::fd::AsFd;
use fn_error_context::context;
use rustix::fd::AsFd;
use rustix::fs::{FileType, MetadataExt};
use std::io::Read;
use std::os::unix::fs::DirBuilderExt;
1 change: 0 additions & 1 deletion rust/src/bwrap.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ use crate::normalization;
use anyhow::{Context, Result};
use cap_std::fs::Dir;
use cap_std_ext::prelude::{CapStdExtCommandExt, CapStdExtDirExt};
use cap_std_ext::rustix;
use fn_error_context::context;
use ostree_ext::{gio, glib};
use std::num::NonZeroUsize;
1 change: 0 additions & 1 deletion rust/src/client.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ use crate::cxxrsutil::*;
use crate::ffi::SystemHostType;
use crate::utils;
use anyhow::{anyhow, Result};
use cap_std_ext::rustix;
use fn_error_context::context;
use gio::prelude::*;
use ostree_ext::{gio, glib};
1 change: 0 additions & 1 deletion rust/src/cliwrap/cliutil.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use anyhow::Result;
use cap_std_ext::rustix;
use nix::sys::statvfs;
use std::os::unix::process::CommandExt;
use std::{thread, time};
Loading

0 comments on commit 2c944d4

Please sign in to comment.